I pushed my local branch to remote on GitHub, and another person made a commit in the branch. I also made commits locally, and when I tried to push it again, it got rejected saying "Updates were rejected because the tip of your current branch is behind". The question is how can I merge the remote commit into my local branch without deleting the commit I made on my local branch, and push it again.
Asked
Active
Viewed 18 times
0
-
just pull it, do any merges locally, then push it again.. Much more info here: https://www.atlassian.com/git/tutorials/merging-vs-rebasing – thebjorn Dec 02 '18 at 12:04
-
`git pull --rebase origin
&& git push origin – phd Dec 02 '18 at 12:33` -
https://stackoverflow.com/search?q=%5Bgit%5D+push+Updates+were+rejected+because+the+tip+of+your+current+branch+is+behind – phd Dec 02 '18 at 12:35
-
Note that there is no *accepted* answer on the duplicate, but if you scroll through them there are two answers with very high upvote counts and both are good. – torek Dec 02 '18 at 18:01