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?
Usage. Gitk is invoked similarly to git log . Executing the gitk command will launch the Gitk UI which will look similar to the following: The upper left pane displays the commits to the repository, with the latest on top. The lower right displays the list of files impacted by the selected commit.
If your latest commit is not a branch head, you may get this error. To fix this, follow the steps below. To save your files, use the git stash command. Then look at the log and get the SHA-1 of the latest commit.
A branch is essentially is a unique set of code changes with a unique name. Each repository can have one or more branches. The main branch — the one where all changes eventually get merged back into, and is called master.
Whenever we need to push the changes to a remote repository, we use git push along with the remote repository “origin” and “master” branches. The term used is “git push origin master“. To pull the changes from the remote repository to local, we use git pull along with remote repository “origin” and “master” branch.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With