In gitk, why is my yellow button above master?

前端 未结 1 754
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-30 03:18

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:

1条回答
  •  有刺的猬
    2020-12-30 03:46

    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 
    

    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.

    0 讨论(0)
提交回复
热议问题