Skip to content

Instantly share code, notes, and snippets.

@waskito
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save waskito/5809305ba826cf80e3b9 to your computer and use it in GitHub Desktop.
Save waskito/5809305ba826cf80e3b9 to your computer and use it in GitHub Desktop.
jegu-git-aliases-in-bash
# 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