Skip to content

Instantly share code, notes, and snippets.

@tomtt
Created July 26, 2017 13:08
Show Gist options
  • Save tomtt/3318eb35ecdbec21cceab0973dbe909a to your computer and use it in GitHub Desktop.
Save tomtt/3318eb35ecdbec21cceab0973dbe909a to your computer and use it in GitHub Desktop.
git-aliases
alias gb='git branch'
alias gba='git branch -a'
alias gc='git commit -v'
alias gci='git commit'
alias gcia='git commit --amend -c HEAD'
alias gco='git checkout'
alias gcp='git cherry-pick'
alias gd='git diff'
alias gdc='git diff --cached --word-diff'
alias gdf='git diff --word-diff'
alias gg='git grep'
alias glb='git log --decorate --oneline'
# alias glg='git log --pretty=oneline --abbrev-commit --graph --decorate'
alias glg='git log --decorate --graph --oneline'
alias gld='git log -p --'
alias gls='git log --stat'
alias gll='git log --pretty=format:"%x1b[33m%h %Cgreen%m%Creset %s %Cgreen(%an)%Creset" -n 10'
alias gllr='gll refs/remotes/origin/HEAD...HEAD;echo " ^ not yet pushed";gll refs/remotes/origin/HEAD'
alias gllt='git log --pretty=format:"%x1b[33m%h %Cgreen%m %x1b[33m%ai %Creset %s %Cgreen(%an)%Creset" -n 10'
alias gpl='git pull'
alias gm='git merge'
alias gps='git push'
alias grom='git rebase origin/master'
alias gsh='git stash'
alias gst='git status'
if [[ $system_label == 'macpro' ]]
then
gitsvn='git svn'
else
gitsvn='git-svn'
fi
alias gsvn="$gitsvn"
alias gsdc="$gitsvn dcommit"
alias gsrb="$gitsvn rebase"
alias gf='git fetch'
alias grb='git rebase'
alias gri='git rebase --interactive'
alias giturl='git config --get remote.`git config --get branch.master.remote`.url'
alias gff='git flow feature'
# complete -o default -o nospace -F _git_branch gb
# complete -o default -o nospace -F _git_branch gba
# complete -o default -o nospace -F _git_commit gc
# complete -o default -o nospace -F _git_commit gci
# complete -o default -o nospace -F _git_checkout gco
# complete -o default -o nospace -F _git_diff gd
# complete -o default -o nospace -F _git_diff gdc
# complete -o default -o nospace -F _git_pull gpl
# complete -o default -o nospace -F _git_log gll
# complete -o default -o nospace -F _git_merge gm
# complete -o default -o nospace -F _git_push gps
# complete -o default -o nospace -F _git_stash gsh
# complete -o default -o nospace -F _git_rebase grb
# complete -o default -o nospace -F _git_rebase gri
# complete -o bashdefault -o default -o nospace -F __git gco
# complete -o default -o nospace -F __git_complete_refs gco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment