Last active
August 29, 2015 14:08
-
-
Save waskito/5809305ba826cf80e3b9 to your computer and use it in GitHub Desktop.
jegu-git-aliases-in-bash
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
# Aliases for git shorty | |
alias gco="git checkout" | |
alias gaa="git add -A ." | |
alias gcm="git commit -m" | |
alias gst="git status" | |
alias glo="git log --graph" | |
alias gpl="git pull" | |
alias gps="git push" | |
alias gbr="git branch" | |
alias gft="git fetch" | |
alias grb="git rebase" | |
alias gdt="git difftool" | |
alias gsn="git show --name-only" | |
# colorful git log | |
alias glc="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative" | |
# gac is used for git add -A .;and then git commit; | |
# usage: | |
# gac "my commit messages in here" | |
gac(){ | |
git add -A .; | |
git commit -m "$*"; | |
} | |
# auto rebase: for git fetch from `remote branch` and rebase it to local | |
# usage: | |
# gar origin development | |
gar(){ | |
git fetch $1 $2; | |
git rebase $1/$2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment