Error in documentation for @{-n} in gitrevisions
- From
Kevin <ikke@ikke.info>
- Date
- Jan 11, 2014, 17:34 UTC
- Message-ID
- <CAO54GHBRbVQWDjE70tEZY=nP==gtrqVvmx1JWYNkc_HOeDnYDA@mail.gmail.com>
While discussing the behavior of "git checkout -", I apparently was confused because the documentation states:
The construct @{-<n>} means the <n>th branch checked out before the
current one.But experimenting with it, it also takes you back to previously checkout commits.
git-checkout-at-minus-one :: (master) » git checkout origin/master Note: checking out 'origin/master'. HEAD is now at f8b2f0c... two
git-checkout-at-minus-one :: (f8b2f0c) » git checkout - Switched to branch 'master'
git-checkout-at-minus-one :: (master) » git checkout -
Note: checking out
'f8b2f0c1419d1fe798159c2c2578d2dbe1323148'.
HEAD is now at f8b2f0c... twoEither the documentation is wrong, and should be changed to "<n>th branch/commit checkout out before the current one", or the behavior of @{-1} is wrong.