Skip to content

Instantly share code, notes, and snippets.

@devth
Created June 27, 2012 16:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devth/3005310 to your computer and use it in GitHub Desktop.
Save devth/3005310 to your computer and use it in GitHub Desktop.
zshrc git aliases
# Git Aliases
alias gitr='cd `git root`'
alias gpr='git pull --rebase && git --no-pager hist @{1}.. && echo'
alias gpom='git push origin master'
alias gs="git status"
alias gp="echo 'Pushing commits:' && git --no-pager hist HEAD@{upstream}.. && echo '' && git push"
alias gd="git diff"
alias gds="git diff --shortstat"
alias gl="git log"
alias gk="gitx"
alias gca="git commit -am "
alias today="git today"
alias gt="git today"
alias week="git week"
alias 2days="git hist --since=2.days.ago"
alias 3days="git hist --since=3.days.ago"
alias gcod="git checkout develop"
alias gcb='git branch | grep "^*" | sed -e "s/* //"'
alias gprp='gpr && gp'
alias gdr='git push origin :@{1}'
# Git with the hub gem
alias h="hub"
alias hb="hub browse"
alias hbc="hub browse -- commit/@$"
# Git functions
function gco(){ git checkout $@ }
function gka(){ gk --all $(git log -g --format="%h" -50) "$@"; }
function gcodate(){ git checkout "`git rev-list HEAD -n 1 --first-parent --before=$@`" && git show HEAD --stat }
@SteeleCoale
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment