I came across a git expression, git show master@{3}
and I have no idea what it's for and how to use it. I get it what is git show
for but the puzzling part here is the @{3}
. In my repo I did try this command, and terminal said fatal: Log for 'master' only has 1 entries.
, so couldn't figure it out from the message.
Could you anyone explain that for me and why I got this specific error. Thanks a ton.
See git help revisions
for help.
@
alone is a shortcut forHEAD
.
HEAD
is explained in the same document:
HEAD names the commit on which you based the changes in the working tree.
And the curly brackets are described there, too:
@{<n>}
, e.g.@{1}
You can use the
@
construct with an empty ref part to get at a reflog entry of the current branch. For example, if you are on branch blabla then@{1}
means the same asblabla@{1}
.
So, @{3}
points to the third prior reflog value from the entry of the current branch.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments