Skip to content

Instantly share code, notes, and snippets.

@mthelander
Created August 8, 2012 18:48
Show Gist options
  • Save mthelander/3297482 to your computer and use it in GitHub Desktop.
Save mthelander/3297482 to your computer and use it in GitHub Desktop.
gitopen function
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