Skip to content

Command line to iterate through a git project's history.

License

Notifications You must be signed in to change notification settings

MarcPer/git-walk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-walk

Command line to iterate through a git project's history, going forward in time (from oldest to newest commit). Requires git to be installed.

Installation

  • 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.

Examples

  • 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
    

How it works

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 and end don't work.

To do

  • 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.

About

Command line to iterate through a git project's history.

Resources

License

Stars

Watchers

Forks

Packages

No packages published