本地分支无法push,提示"fatal: The current branch 。。。"

fatal: The current branch test has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin test

执行git push --set-upstream origin test就可以了,为什么?

阅读 2.3k
1 个回答

就是让你指定当前分支的上游分支 不然不知道你想推到哪个分支,因为本地分支和远程分支名称并不限制必须一致。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题