I am getting the following when running git status
Your branch is ahead of 'origin/master' by 3 commits.
I have read on some other post the way to fix this is run git pull --rebase
but what exactly is rebase, will I lose data or is this simple way to sync with master?
You get that message because you made changes in your local master and you didn't push them to remote. You have several ways to "solve" it and it normally depends on how your workflow looks like:
git push origin
assuming origin is your remotegit reset --hard origin/master