我在本地建了一个分支wangxiao,开发完以后,提交代码git
git add .
git commit -m '注释'
git push
出现下面的问题,这个意思是:当前分支没有与远程分支关联。
所以致使了提交代码失败。web
MacBook-Pro-5:web-crm wangxiao$ git push
fatal: The current branch wangxiao has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin wangxiao
解决方案:
(1)直接 git push origin wangxiao 推向制定的分支,最强暴的方法。
(2)正如上面所说关联远程分支。spa
git push --set-upstream origin wangxiao
origin 是默认的远程版本库名称
这样关联有一个好处,之后就不用每次git push都用第(1)种方法。
--------------------- .net
https://blog.csdn.net/boysky0015/article/details/81007897blog