Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the list of recently checked out references stored, such as those used by `git checkout -`

Tags:

git

git checkout - checks out the previously checked out commit reference. Where is this information stored, and is there a similar way to access any nth previously checked out commit?

I would like to be able to look at a list of the references I've checked out (particularly as opposed to looking at every available branch) so that I can easily find the branches I've worked on locally. Obviously, this situation only occurs with large, multi user repositories.

like image 935
bschlueter Avatar asked Dec 18 '25 09:12

bschlueter


1 Answers

git checkout @{-N}

From the man page: http://git-scm.com/docs/git-checkout

As a special case, the "@{-N}" syntax for the N-th last branch/commit checks out branches (instead of detaching). You may also specify - which is synonymous with "@{-1}".

like image 50
NightShadeQueen Avatar answered Dec 20 '25 01:12

NightShadeQueen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!