In gitk, why is my yellow button above master?

本小妞迷上赌 提交于 2019-11-29 06:30:27

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/896832/in-gitk-why-is-my-yellow-button-above-master

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!