Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
.gitrc aliases for common git commands
# Aliases for common git commands. E.g., enter "git d" for "git diff"
# These settings live in the ~/.gitconfig file.
b = branch
ba = branch -a
ci = commit
co = checkout
d = diff
dc = diff --cached
fp = format-patch
g = !git gui &
gr = log --graph
go = log --graph --pretty=oneline --abbrev-commit
k = !gitk &
ka = !gitk --all &
lc = log ORIG_HEAD.. --stat --no-merges
lp = log --patch-with-stat
mnf = merge --no-ff
mnff = merge --no-ff
mt = mergetool
p = format-patch -1
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git
sra = svn rebase --all
sh = !git-sh
st = status
stm = status --untracked=no
stfu = status --untracked=no
pullsrb = !git stash save && git pull --rebase && git stash pop && echo 'Success!'

This comment has been minimized.

Copy link

@ye ye commented Sep 25, 2013

Thanks @igal for sharing!


This comment has been minimized.

Copy link

@danieluhl danieluhl commented Apr 25, 2014

Great list @igal! I prefer to put these as bash alias in my ~/.bashrc to avoid having to type 'git':

alias b="git branch"
alias ba="git branch -a"
alias ci="git commit"
alias co="git checkout"
alias d="git diff"
alias dc="git diff --cached"
alias fp="git format-patch"
alias g="git !git gui &"
alias gr="git log --graph"
alias go="git log --graph --pretty=oneline --abbrev-commit"
alias k="git !gitk &"
alias ka="git !gitk --all &"
alias lc="git log ORIG_HEAD.. --stat --no-merges"
alias lp="git log --patch-with-stat"
alias mnf="git merge --no-ff"
alias mnff="git merge --no-ff"
alias mt="git mergetool"
alias p="git format-patch -1"
alias serve="git !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git"
alias sra="git svn rebase --all"
alias sh="git !git-sh"
alias st="git status"
alias stm="git status --untracked=no"
alias stfu="git status --untracked=no"
alias pullsrb="git !git stash save && git pull --rebase && git stash pop && echo 'Success!'"

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