我想我在进入分支之前执行了“git pull”,现在当我执行“gitbranch”时,它会显示以下内容:
* (no branch)
master
如何将“无分支”移至“主分支”,以便我可以执行“git Push”?
最佳答案
在分支之间移动:
git checkout <branch_name>
要推送分支的提交而不位于分支中,您可以在push
命令后指定更多参数:
git push <remote> <branch_name>
这将推送跟踪名为 branch_name
的远程分支的本地分支。
关于Git错误: failed to push some refs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11618062/