Skip to content

Instantly share code, notes, and snippets.

@zarkzork
Created September 10, 2011 10:05
Show Gist options
  • Save zarkzork/1208164 to your computer and use it in GitHub Desktop.
Save zarkzork/1208164 to your computer and use it in GitHub Desktop.
aliases for diffing list of files before commit
alias last_change='git diff $(git status | sed -ne "/Changed/,/Untrack/ p" | grep modified | cut -d: -f2 | head -1)'
alias add_last_change='git add $(git status | sed -ne "/Changed/,/Untrack/ p" | grep modified | cut -d: -f2 | head -1)'
alias edit_last_change='$EDITOR $(git status | sed -ne "/Changed/,/Untrack/ p" | grep modified | cut -d: -f2 | head -1)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment