Category Archives: git

Git: push rejected – cannot pull with rebase – local out of date

When you push a branch to a remote branch that has been updated by someone else in the meantime, without doing a pull before to update your local working directory, you will get the follow error:

$ git push
To ...
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '...'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.

Continue reading