Last active
October 9, 2015 19:47
-
-
Save shashankmehta/3566279 to your computer and use it in GitHub Desktop.
Bash aliases for Git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
} |
All start with "git". I can shorten them even further.
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
Why don't you uses actual git aliases?