I am not able to push on git?

后端 未结 6 851
傲寒
傲寒 2020-12-24 15:05

git push origin master shows an error

failed to push some refs to \'git@github.com:xyz/abc.git\' To prevent you from losin

6条回答
  •  借酒劲吻你
    2020-12-24 15:33

    Quite important: this can also occur if name of the branch you are on (and want to merge) and the branch upstream are not the same. Then work flow could look like this:

    git pull --rebase             # to retrieve upstream changes, replay yours on top
    git push --dry-run --verbose origin HEAD:master   # always good idea: dry-runs..
    git push origin HEAD:master   # actually push current branch head (non-master) to upstream master
    

提交回复
热议问题