bmacnaughton
bmacnaughton

Reputation: 5308

why is there additional information the first commit line in git log output?

The first commit line in my git log has recently started showing:

commit 8d8cc487c2b91a2d18edbfbafe9d6700f764fe04 (HEAD -> master, origin/master, origin/HEAD)

Head -> (in blue)
master -> (in green)
origin/master and origin/HEAD (in red)

What is this telling me and why did it start showing up?

Upvotes: 2

Views: 333

Answers (2)

rodrigo
rodrigo

Reputation: 98348

This is the output of the --decorate option of git-log. I think that it changed the default value, from none to short at some recent git version.

When that git log --decorate (or git config log.decorate) is short, then for each commit shown in a log it will show also any alternate name that refers to this commit. The color is the type of name:

  • Green: local branch.
  • Red: remote branch.
  • Brown: tag.
  • Blue: symbolic name, such as HEAD, a name that refers to other name. You will see an arrow -> pointing to that other name.

If you don't like it (but why shouldn't you?) you can disable it with git config log.decorate none.

Upvotes: 4

Makoto
Makoto

Reputation: 106430

In order:

  • HEAD is the commit that Git is currently pointed at.
  • master represents the the tip of your branch. Here, master could be any other branch.
  • origin/master represents the tip of your remote branch.
  • origin/HEAD represents the commit that Git is pointed at on your remote repository.

Upvotes: 4

Related Questions