Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In gitk, why is my yellow button above 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?

like image 953
rick Avatar asked May 22 '09 08:05

rick


People also ask

What is GITK command?

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.

Why is git push showing everything up to date?

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.

What is the difference between main and master branch?

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.

How do you push origin 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.


1 Answers

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.

like image 96
Bombe Avatar answered Oct 20 '22 21:10

Bombe