Git :Updates were rejected because your tip of current branch is behind

Posted by

To github.com:holidaylandmark/holiday.git
 ! [rejected]          master -> master (non-fast-forward)
error: failed to push some refs to 'github.com:holidaylandmark/holiday.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Solution

git push -f, a force push to update the remote (origin) branch.
1. Take a backup if you're working on feature branch and switch to master/develop branch by doing git checkout develop/master
2. Do git pull
3. You will get changes and merge conflicts occur when you have made changes in the same file which has not been rebased from develop/master
4. Resolve the conflicts if it occurs and do git push,this should work
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x