在gitk中,为什么我的黄色按钮位于master上方?
我在 gitk 上找不到任何关于颜色含义的文档,但我认为这里的问题是我的黄色按钮已经通过了我的主人。 现在,当我尝试执行以下操作时:
git push origin master
它不起作用。 我的黄色按钮是如何超越 master 的,如何让它们重新组合在一起,以便我可以推送 origin master?
I couldn't find any documentation on gitk about what the colors mean, but the problem here I think is that my yellow button has passed my master. Now when I try to do:
git push origin master
It doesn't work. How did my yellow button get over master and how do I get them back together so I can do push origin master?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您需要将该提交放回 master 分支(如果它属于那里)。 而且看起来您已经分离了 HEAD,因为该提交不是分支头。 如果所有这些都是正确的,请尝试以下操作:
记住提交 ID。
现在,
gitk
将在master
标记旁边显示黄色提交,并且git Push
将再次工作。至于你是如何陷入这种情况的,我唯一能想象的是你使用 git reset 将 master 分支重置为之前的提交,但没有更改当前的提交签出提交。
Looks you need to put that commit back into the
master
branch (if it belongs there). Also it looks like you’ve detached HEAD because that commit is not a branch head. If all this is true, try the following:Remember the commit ID.
Now
gitk
will show the yellow commit right next to themaster
marker andgit push
will be working again.As to how you got into that situation, the only thing I can imagine is that you used
git reset
to reset themaster
branch to a previous commit but have not changed the currently checked-out commit.