0

There is an open source project to which I want to contribute to. I forked it and set the upstream to my master from the remote master. Now I created another branch add_func. I made some changes to this branch but by the time I completed it, there were many changes in the remote one. I followed these steps:

  1. git pull upstream master && git push origin master
  2. Modify things in my local branch add_func
  3. git push orign add_func

But I am getting error Updates were rejected because the tip of your current branch is behind its remote counterpart. Integrate the remote changes.

Note: I already made a pull request with the add_func branch. By the time it got reviewed, there were changes. So, I cannot delete this branch or merge it into master.

PS: I know there are similar questions and I have checked them out but none of them have the answer I am looking for.

enterML
  • 2,110
  • 4
  • 26
  • 38
  • Possible duplicate of [Cannot push to GitHub - keeps saying need merge](https://stackoverflow.com/questions/10298291/cannot-push-to-github-keeps-saying-need-merge) – phd May 18 '19 at 12:19
  • https://stackoverflow.com/search?q=%5Bgit%5D+Updates+were+rejected+because+the+tip+of+your+current+branch+is+behind+its+remote+counterpart – phd May 18 '19 at 12:19

1 Answers1

1

Updates were rejected because the tip of your current branch is behind its remote counterpart. Integrate the remote changes

Seems like there are changes/commits in remote add_func that does not exit in local add_func branch. Pull add_func first, then push:

$ git pull origin add_func
$ git push origin add_func
Sajib Khan
  • 22,878
  • 9
  • 63
  • 73