Skip to content

Instantly share code, notes, and snippets.

@clauswitt
Created January 9, 2012 12:54
Show Gist options
  • Select an option

  • Save clauswitt/1582827 to your computer and use it in GitHub Desktop.

Select an option

Save clauswitt/1582827 to your computer and use it in GitHub Desktop.
Zsh function to git add last parameter of last command
alias c='git commit '
alias gd='git diff '
gal() {
last_command=$history[$[HISTCMD-1]];
last_command_array=("${(s/ /)last_command}")
echo $last_command_array[-1];
git add $last_command_array[-1];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment