Created
August 8, 2012 18:48
-
-
Save mthelander/3297482 to your computer and use it in GitHub Desktop.
gitopen function
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
function gitopen() { | |
if [ -z $1 ]; then # Open all changed files | |
eval "$EDITOR \$(git status --porcelain --untracked-files=all | sed -re 's/^.+\s//')" | |
else # All files changed in the last number of specified commits | |
eval "$EDITOR \$(git show -$1 --name-only --oneline | sed -re '/^.*[0-9]+.*/d')" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment