我在大学计算机上设置了 egit 来使用我的 GitHub 存储库。
该存储库有 5 个分支,包括 master,我的本地副本也有这些分支,因此我可以转到 Team -> Switch to
并在 eclipse 中选择所需的分支。
在我的笔记本电脑上,我设置了 Egit 并克隆了存储库。
我在导入时选择了所有分支,但是在 git 存储库选项卡中的本地下,它只有主分支,所有其他分支都在远程跟踪下。
如果我切换到远程跟踪分支进行更改,提交然后推送,我会收到以下错误:
An internal Exception occurred during push: Nothing to push.
有人知道我做错了什么吗? 谢谢
最佳答案
If I switch to a Remote Tracking branch make a change, commit and then push I get the following error
您没有从刚刚切换到的远程跟踪分支创建本地分支。
这意味着您处于 detached HEAD
mode 中,因此“没有什么可 push 的”。
请参阅“Git Lesson: Be mindful of a detached head”:
(没有HEAD
:)
Team -> Switch To -> New Branch
足以解决问题,然后将其推送到远程。
(新分支上的HEAD
:)
关于git - 从 github 导入所有分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9267805/