Cannot push to GitHub - keeps saying need merge

后端 未结 30 2285
天命终不由人
天命终不由人 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:56

    Some of you may be getting this error because Git doesn't know which branch you're trying to push.

    If your error message also includes

    error: failed to push some refs to 'git@github.com:jkubicek/my_proj.git'
    hint: Updates were rejected because a pushed branch tip is behind its remote
    hint: counterpart. If you did not intend to push that branch, you may want to
    hint: specify branches to push or set the 'push.default' configuration
    hint: variable to 'current' or 'upstream' to push only the current branch.
    

    then you may want to follow the handy tips from Jim Kubicek, Configure Git to Only Push Current Branch, to set the default branch to current.

    git config --global push.default current
    

提交回复
热议问题