从 github 导入所有分支

发布于 2025-01-05 00:11:34 字数 369 浏览 3 评论 0原文

我在大学计算机上设置了 egit 来使用我的 GitHub 存储库。
该存储库有 5 个分支,包括 master,我的本地副本也有这些分支,因此我可以转到 Team ->切换到 并在 eclipse 中选择所需的分支。

在我的笔记本电脑上,我设置了 Egit 并克隆了存储库。
我在导入时选择了所有分支,但是在 git 存储库选项卡中的本地下,它只有主分支,所有其他分支都在远程跟踪下。
如果我切换到远程跟踪分支进行更改,提交然后推送,我会收到以下错误:

An internal Exception occurred during push: Nothing to push.

有人知道我做错了什么吗? 谢谢

I set up egit to work with my GitHub repo on my university computer.
The repo has 5 branches including master and my local copy also has those branches so I can go to Team -> Switch to and select the desired branch in eclipse.

On my laptop I set up Egit and cloned the repo.
I selected all branches when importing however under Local in the git repositories tab it only has master, all the other branches are under Remote Tracking.
If I switch to a Remote Tracking branch make a change, commit and then push I get the following error:

An internal Exception occurred during push: Nothing to push.

Anyone know what I am doing wrong?
thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

∞梦里开花 2025-01-12 00:11:34

如果我切换到远程跟踪分支进行更改,提交然后推送,我会收到以下错误

您没有从您刚刚切换到的远程跟踪分支创建本地分支。
这意味着您处于 分离的 HEAD 模式,因此“无需推送”。
请参阅“Git 课程:注意分离的头部”:(

HEAD:)

no head

Team -> Switch To -> New Branch

足以解决问题,然后将其推送到远程。

(新分支上的 HEAD:)

新分支上的 HEAD

If I switch to a Remote Tracking branch make a change, commit and then push I get the following error

You didn't create a local branch from your remote tracking branch you just switch to.
That means you are in a detached HEAD mode, hence the "nothing to push".
See "Git Lesson: Be mindful of a detached head":

(No HEAD:)

no head

Team -> Switch To -> New Branch

will be enough to fix the issue, and then push it to the remote.

(HEAD on the new branch:)

HEAD on the new branch

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文