Possible Duplicate:
Git non-fast-forward rejected
How to fix this error? It didn't happen previously
Possible Duplicate:
Git non-fast-forward rejected
How to fix this error? It didn't happen previously
git pull origin master
will grab the remote's changes and merge them with yours.
git rebase origin/master
will replay you local changes not in the remote on top of any changes on remote. After you do a git fetch origin
, pulling automatically does the fetch step. Learn about rebasing in git.
What happened is that someone else (or you on a different machine) also pushed to the origin repo with a different set of commits. Until you have those commits, it won't let you push unless you include --force
. Don't do that unless you have to by the way.
Well the message tells you what to do: git pull, (fetches and merges changes), then git push again.