在gitk中,为什么我的黄色按钮高于主? [英] In gitk, why is my yellow button above master?

查看:220
本文介绍了在gitk中,为什么我的黄色按钮高于主?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到关于gitk颜色的任何文档,但我认为这里的问题是我的黄色按钮已经通过了我的主人。现在,当我尝试做:

git push origin master



它不起作用。我的黄色按钮是如何超越主人的,我如何将他们重新组合在一起,以便我可以推送原始主人?

您需要将该提交放回 master 分支(如果它属于那个分支)。此外,它看起来像你已经分离HEAD,因为该提交不是分支头。如果这一切都是真的,请尝试以下操作:

 #git log -1 



请记住提交ID。

 #git checkout master 
#git reset --hard< commit-id>

现在 gitk 会显示黄色提交权限 master 标记和 git push 旁边的内容将再次显示。



至于你如何进入这种情况,我能想象的唯一情况是你使用了 git reset 来重置 master code>分支到之前的提交,但没有改变当前签出的提交。


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?

解决方案

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:

# git log -1

Remember the commit ID.

# git checkout master
# git reset --hard <commit-id>

Now gitk will show the yellow commit right next to the master marker and git 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 the master branch to a previous commit but have not changed the currently checked-out commit.

这篇关于在gitk中,为什么我的黄色按钮高于主?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆