SpaceMonkey55
SpaceMonkey55

Reputation: 457

Explanation of commit line in a git log entry

Sometimes I see a lot of branching information when I call a git log on my repo. For example:

commit COMMIT_HASH (HEAD -> CURRENT_BRANCH, tag: A_TAG, ANOTHER_BRANCH, ANOTHER_BRANCH)
Author: AUTHOR_NAME
Date: DATE

    LOG MESSAGE

My question is about part in the first line of the message. After the COMMIT_HASH theres some information about what I believe is some kind history of the branch. In honesty, I did not go through the whole description of git log; however, I could not find the description of its output format. An explanation or a link to the information would be appreciated.

Upvotes: 1

Views: 100

Answers (1)

Romain Valeri
Romain Valeri

Reputation: 22067

This is what's called "decorations". It shows which refs are currently pointing to this commit.

You can control the display of this information with --decorate (by default) / --no-decorate. (doc)


And to answer your question in comment (does this mean this head points to all the 4 things mentioned?) :

No. HEAD points only to one thing. Typically, the currently checked out branch, but it could be just a commit (in case of detached HEAD state). You can have other refs which happen to point to the same commit, but HEAD only points to one.

Upvotes: 2

Related Questions