Skip to content

Instantly share code, notes, and snippets.

@drouillard
Last active September 9, 2015 14:07
Show Gist options
  • Save drouillard/43fed6343526754d0987 to your computer and use it in GitHub Desktop.
Save drouillard/43fed6343526754d0987 to your computer and use it in GitHub Desktop.
git shortcuts
alias gs='git status'
alias gd='git diff'
alias ga='git add'
alias gn="git ls-files -m | head -1"
alias gnd='gn | xargs git diff'
alias gna='gn | xargs git add; gs; gnd'
alias gnp='git push origin HEAD'
# dangerous so commented out by default
#alias gnc='gn | xargs git checkout'

Workflow:

  1. Do Work
  2. Run gs to get idea of all that needs to be checked in
  3. Run through changes with gnd
  4. Add with gna which will then show next file
  5. Continue until no more files left
  6. Push with gnp

Limitations

  1. Files with ../
  2. Trying to review files out of order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment