背景:
开发过程中新建了一个分支,开发之后,并没有进行merge操作,在push的时候报错
具体错误
fatal: The current branch xxxx has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin test_branch
- 感觉主要原因在于当前这个分支没有和任何的仓库发生关联,origin是仓库的一个指针,需要将当前的分支与这个指针之间形成关联。
解决
按照提示执行
git push --set-upstream origin test_branch
执行之后会在github上自动新建一个test_branch的分支。