I'm really not that comfortable with using command-line for git
, so I prefer using SourceTree
, but the UI can't solve one of my problems (it reloads all the time to the top).
Actually I want to checkout the very first commit of the Swift
repository (which has almost 40k commits) and then only checkout every next commit by commit and see what has changed (I'd like to learn how the language was written).
Imagine one would iterate an array from index 0 without knowing if there is a successor and which information it might have (like commit id).
Is there any script or commands I could use?
Update:
I found the answer by myself here.
moving to next commit
function n() { git log --reverse --pretty=%H master | grep -A 1 $(git rev-parse HEAD) | tail -n1 | xargs git checkout }
moving to previous commit
function p() { git checkout HEAD^1 }