Skip to content

Instantly share code, notes, and snippets.

@shashankmehta
Last active October 9, 2015 19:47
Show Gist options
  • Save shashankmehta/3566279 to your computer and use it in GitHub Desktop.
Save shashankmehta/3566279 to your computer and use it in GitHub Desktop.
Bash aliases for Git
# Initially sourced from http://www.catonmat.net/blog/git-aliases/
alias ga='git add'
alias gp='git push'
alias gl='git log'
alias gs='git status'
alias gd='git diff'
alias gdc='git diff --cached'
alias gc='git commit'
alias gca='git commit -a'
alias gb='git branch'
alias gco='git checkout'
alias gf='git fetch'
alias gr='git rebase'
alias gra='git remote add --track'
alias gpu='git pull'
alias gcl='git clone'
alias cdp='cd /home/shashank/projects/'
alias cdps='cd /home/shashank/projects/sdslabs/'
alias g='git'
alias cdpp='cd /home/shashank/projects/personal/'
alias static='python -m SimpleHTTPServer'
function gst() {
if [ -z "$1" ]; then
git stash list
elif [ "$1" == "a" ]; then
git stash apply stash@{"$2"}
elif [ "$1" == "c" ]; then
git stash
elif [ "$1" == "d" ]; then
git stash drop stash@{"$2"}
fi
}
@abhshkdz
Copy link

abhshkdz commented Sep 1, 2012

Why don't you uses actual git aliases?

@shashankmehta
Copy link
Author

All start with "git". I can shorten them even further.

@abhshkdz
Copy link

These are actually git aliases, hence I suggested. And they can be shortened further.

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