Git master branch has no upstream branch

前端 未结 10 742
北荒
北荒 2021-01-30 16:53

I\'m trying to push one of my projects to github, and I keep getting this error:

fatal: The current branch master has no upstream branch.

I\'ve

10条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 17:03

    Some people coming to this page may simply have this error because they did git push origin and simply didn't realise that you need to specify the remote branch name as well, as in git push origin master.

    If you do git branch --set-upstream-to=origin/master master a reference is added to .git\config to link the local and remote branches. I presume that then you no longer need to specify the branch name when pushing to the remote.

提交回复
热议问题