Created
August 9, 2013 13:41
-
-
Save brianewing/6193666 to your computer and use it in GitHub Desktop.
Git command for opening files from previous commits / other branches in your editor
This file contains hidden or 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 | |
unless ARGV.length >= 2 | |
STDERR.puts "git old <commit/refspec> <file> [file2] ..." | |
Kernel.exit(1) | |
end | |
ref = ARGV.shift | |
ARGV.each { |f| `git show #{ref}:#{f} | $EDITOR` } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment