eVagabond
eVagabond

Reputation: 241

What does this commit message mean?

I am getting the following message in one of my commit message when I view my local git log.

HEAD -> dev, origin/master, origin/dev, master

Can anybody please explain?

Update

Finally, I've come up with an explanatory answer:

Upvotes: 1

Views: 373

Answers (2)

Schwern
Schwern

Reputation: 165606

HEAD -> dev, origin/master, origin/dev, master

That would really look something like this:

commit aa1124b89f38eed793e2b9f2d2b2ba5d80a27a20 (HEAD -> dev, origin/master, origin/dev, master)
Author: Some Person <[email protected]>
Date: Sat Apr 14 12:06:02 PDT 2018

That is the result of git log --decorate or having log.decorate set to short in your config. It shows you anything which referrers to each commit (references are things like branches and tags). This is important information for understanding the log.

This means that the local branches dev and master, plus the remote branches origin/master and origin/dev plus the special reference HEAD all point at commit aa1124b89f38.

HEAD is itself a special reference pointing to the currently checked out commit.

HEAD -> dev says dev is the currently checked out branch.

Having dev and master at the same commit means there are no differences between dev and master.

origin/master is the remote tracking branch for master. It keeps track of where master was on the remote called origin the last time you ran git fetch (or git pull which does a git fetch); Git doesn't continuously know the state of the remotes, it only looks when you ask. Having origin/master and master pointing at the same commit says you haven't committed anything to master since the last time you looked at origin.

In sum...

  • All those branches point HEAD which is what you have checked out.
  • dev is the currently checked out branch.
  • dev and master are at the same commit, they have no differences.
  • Nothing has been added to dev nor master since your last git fetch.

See also

Upvotes: 1

Richard
Richard

Reputation: 109180

git log (which is the underlying command for showing history) can annotate the history display in various ways. One of these is to show what branches reference a commit.

Specifically the --decorate option "Print out the ref names of any commits that are shown" (branches and tags are two examples of refs).

Upvotes: 2

Related Questions