Created
December 22, 2014 04:41
-
-
Save markryall/692a0659fbec594174e4 to your computer and use it in GitHub Desktop.
git-step
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
all = `git rev-list master --reverse`.split | |
if File.exist?('.git-step') | |
index = all.index File.read('.git-step').chomp | |
index += 1 if index | |
end | |
index ||= 0 | |
index = all.count - 1 unless all[index] | |
current = all[index] | |
puts "Jumping to commit #{current} (#{index+1} of #{all.length})" | |
`git checkout #{current} 2>&1 > /dev/null` | |
File.write '.git-step', current |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment