Is it possible (somehow) to have in Git (local) relative revision (commit) numbers, like in Mercurial 0, 1, 2, 3, ... instead of short hashes?
Or anything more user friendly?
Other than that there are no revision numbers in git. You'll have to tag commits yourself if you want more user-friendliness.
}) ref~ is shorthand for ref~1 and means the commit's first parent. ref~2 means the commit's first parent's first parent. ref~3 means the commit's first parent's first parent's first parent.
Git allows you to refer to a single commit, set of commits, or range of commits in a number of ways.
Just use:
master~10
to get the 10th last commit on branch master
.master^
to get the second last commit on branch master
.master^^
to get the third last commit on branch master
.They can even be combined: master^^~5^
.
master
can be any branch name (local or remote) or HEAD
to reference the current commit.
You can use master^2
to get the second merge parent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With