Cannot push to GitHub - keeps saying need merge

后端 未结 30 2270
天命终不由人
天命终不由人 2020-11-22 00:09

I\'m new to GitHub. Today I met some issue when I was trying to push my code to GitHub.

Pushing to git@github.com:519ebayproject/519ebayproject.git
To git@gi         


        
30条回答
  •  盖世英雄少女心
    2020-11-22 00:41

    I was getting the above mentioned error message when I tried to push my current branch foobar:

    git checkout foobar
    git push origin foo
    

    It turns out I had two local branches tracking the same remote branch:

    foo -> origin/foo (some old branch)
    foobar -> origin/foo (my current working branch)
    

    It worked for me to push my current branch by using:

    git push origin foobar:foo
    

    ... and to cleanup with git branch -d

提交回复
热议问题