HEAD -> master in git log? [Beginner]

should (HEAD->master) message be shown at the top with latest commit from
git log --oneline command,
does that message only tell on which branch Im currently at?
Hello there :raised_hand_with_fingers_splayed:, I have just begun studing git versrion control, I watched some old tutorials about git basics and there I didn’t see any message like that while showing commits list (when using git log), now when I made several commits I saw that (HEAD -> master) message so I was curious what that meant and as I learned HEAD is just something like ref to another ref which is applied to the latest commit in branch, am I right? so what is the point of showing that message, just to tell on which branch Im currently at?
I achieved hiding that message by using decorate=no with git log command, could I make that default for git log?, as I saw in documentation git log uses decoration=short by default and there is mentioned that decorate=short hides refs, ( if I understood it correctly) but it didn’t do that. why? :sweat_smile:

If anyone wants to know what the hell HEAD tag is and why does it point to the master just look this up: https://people.gnome.org/~federico/news-2008-11.html

any comments would be appreciated I’m just reeal beginner at the moment

Most of the time HEAD points at the latest commit in a branch, yes, but it can also point at a plain commit, if you checkout one without creating a branch. That’s called “detached HEAD”.

Yes. Set the log.decorate option to no, either using git config or by editing the configuration directly.

Because it doesn’t hide refs, it hides the refs/TYPE/ prefix for the refs that are shown. For example, with full instead of short you’d see refs/heads/master instead of master.

In general I recommend you take a look at the Git Book. :wink:

1 Like

Thank you so much for answers

1 Like