Command line to iterate through a git project's history, going forward in time (from oldest to newest commit). Requires git to be installed.
- Download latest binary from releases page, choosing the right platform.
- Place binary into a
$PATH
folder.
Below we assume the binary is renamed to git-walk
.
-
Move to the first commit, by commit time, in the current history:
git-walk to start
-
Checkout a given commit, while allowing navigation to commits created after it:
git-walk to start <commit>
-
Go to the commit created after the current one:
git-walk to next
-
Go to last known non-detached HEAD, saved into .git-walk file when
git-walk to start
is run.git-walk to end
git-walk, when used with start
or next
checks out a commit, so git HEAD becomes detached.
Whenever git-walk to start
is run and git HEAD is not detached, the current reference is saved into the .git-walk file. git-walk uses it to go back to the reference, even if git HEAD is in detached state.
Note that one should not run
git-walk to start
for the first time while HEAD is detached, as a non-detached reference needs to be saved. Otherwise,next
andend
don't work.
- Better error handling. Stderr and exit codes are currently ignored.
- Allow for moving multiple commits with something like
git-walk to next 10
. - Possibly include .git-walk file into .git/info/exclude automatically, so it is not tracked by git.