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

git checkout -

checks a previously registered commit reference. Where is this information stored and is there a similar way to access any n-th previously registered commit?

I would like to be able to view the list of links that I have checked out (especially as opposed to looking at every available branch) so that I can easily find the branches that I have been working on locally. Obviously this situation only occurs with large multi-user repositories.

+3


source to share


2 answers


git checkout @{-N}

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



As a special case, the "@ {- N}" syntax for the Nth last branch / commit checks for branches (instead of checking out). You can also specify - which is a synonym for "@ {- 1}".

+1


source


If you want to check some of the previous versions, you need to find the hash of the version using the command

 git log --oneline

      

It will list all of your older commits:

 ac7dfd7 Bumped version number of exception chains dependency
 0390d4c Changed target to match project name in proxy object
 4beef4e updated docs
 de07e72 Merge branch 'master' of github.com:ucam-cl-dtg/resteasy-api-example
 39653ff ignore ~ files
 c7fd3fb initial check in
 427783d initial gitignore file
 bbe1aba Initial commit

      



Now you can choose which one you want to check:

git checkout 39653ff

      

Hope this is exactly what you are looking for.

Zoran

-2


source







All Articles