Andrew Kim
Andrew Kim

Reputation: 3335

In a git reflog, HEAD@{0} is called what exactly?

If I reflog my master branch on a simple repository. It might look something like this:

33e8ab2 master@{0}: commit: 3rd commit
e054213 master@{1}: commit: 2nd commit
d57537e master@{2}: commit: 1st commit
bbc0c23 master@{3}: commit: initial commit

What exactly do you call master@{n}?

My initial though was that it was a reference. But references point to a specific commit. Is it a relative reference, that is, relative to the number of actions on the tip of the branch?

My questions:

What is the most semantic term for things like: master@{n}, HEAD@{n}, master@{1.day.ago}?

Are all three of the above the same types of things?

Upvotes: 0

Views: 977

Answers (2)

ElpieKay
ElpieKay

Reputation: 30868

It's one of gitrevisions. Specifically, <ref>@{n} specifies the n-th prior value of that ref.

Upvotes: 2

ntshetty
ntshetty

Reputation: 1305

The meanings from git reflog --help

Reflogs are useful in various Git commands, to specify the old value of a reference.

For example:

  HEAD@{2} means "where HEAD used to be two moves ago", 

  master@{one.week.ago} means "where master used to point to one
  week ago in this local repository",

Upvotes: 2

Related Questions