Skip to content

Instantly share code, notes, and snippets.

@jcarouth
Created April 10, 2012 15:24
Show Gist options
  • Save jcarouth/2352109 to your computer and use it in GitHub Desktop.
Save jcarouth/2352109 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Aliases
alias gcl='git clone'
alias ga='git add'
alias gall='git add .'
alias g='git'
alias get='git'
alias gst='git status'
alias gs='git status'
alias gss='git status -s'
alias gl='git pull'
alias gup='git fetch && git rebase'
alias gp='git push'
alias gpo='git push origin'
alias gdv='git diff -w "$@" | vim -R -'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gci='git commit --interactive'
alias gb='git branch'
alias gba='git branch -a'
alias gcount='git shortlog -sn'
alias gcp='git cherry-pick'
alias gco='git checkout'
alias gexport='git archive --format zip --output'
alias gdel='git branch -D'
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/master'
alias gll='git log --graph --pretty=oneline --abbrev-commit'
alias grma='git ls-files --deleted | xargs git rm'
case $OSTYPE in
linux*)
alias gd='git diff | vim'
;;
darwin*)
alias gd='git diff'
;;
darwin*)
alias gd='git diff'
;;
esac
function git-help() {
echo "Git Custom Aliases Usage"
echo
echo " gcl = git clone"
echo " g = git"
echo " get = git"
echo " ga = git add"
echo " gall = git add ."
echo " gst/gs = git status"
echo " gss = git status -s"
echo " gl = git pull"
echo " gup = git fetch && git rebase"
echo " gp = git push"
echo " gd = git diff | mate"
echo " gdv = git diff -w \"$@\" | vim -R -"
echo " gc = git commit -v"
echo " gca = git commit -v -a"
echo " gci = git commit --interactive"
echo " gb = git branch"
echo " gba = git branch -a"
echo " gcount = git shortlog -sn"
echo " gcp = git cherry-pick"
echo " gco = git checkout"
echo " gexport = git git archive --format zip --output"
echo " gdel = git branch -D"
echo " gpo = git push origin"
echo " gmu = git fetch origin -v; git fetch upstream -v; git merge upstream/master"
echo " gll = git log --graph --pretty=oneline --abbrev-commit"
echo " grma = git ls-files --deleted | xargs git rm"
echo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment