What is the quickest way to checkout revision which is next (later in the time) to HEAD (when you are in detached head state)?
This should be something like:
git checkout HEAD~-1
but this command doesn't work. Also git log
, which doesn't show next revision hash.
The only way, which I found is:
git checkout master
git log
[find revision number]
git checkout <revnumber>
but it looks very slow. Is there a one command for this?
No, there would not be a single git command. The revision that you are at when you are in a detached state could have multiple locations to go. It is possible that at that revision, you created multiple branches each with separate commits. So in that case what would be the next revision that you want?
You would need to let git know the branch that you want to get the next commit on. So that Git knows where to look for the next commit.