Created
May 2, 2013 22:06
-
-
Save jhulten/5505837 to your computer and use it in GitHub Desktop.
git aliases
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
[alias] | |
ci = commit | |
co = checkout | |
st = status | |
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -" | |
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short | |
tree = log --oneline --decorate --graph | |
ctags = !.git/hooks/ctags | |
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat | |
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate | |
lnc = log --pretty=format:"%h\\ %s\\ [%cn]" | |
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative | |
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short | |
filelog = log -u | |
fl = log -u | |
dlc = diff --cached HEAD^ | |
dr = "!f() { git diff "$1"^.."$1"; }; f" | |
lc = "!f() { git ll "$1"^.."$1"; }; f" | |
diffr = "!f() { git diff "$1"^.."$1"; }; f" | |
f = "!git ls-files | grep -i" | |
grep = grep -Ii | |
gra = "!f() { A=$(pwd) && TOPLEVEL=$(git rev-parse --show-toplevel) && cd $TOPLEVEL && git grep --full-name -In $1 | xargs -I{} echo $TOPLEVEL/{} && cd $A; }; f" | |
done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f" | |
ours = "!f() { git co --ours $@ && git add $@; }; f" | |
theirs = "!f() { git co --theirs $@ && git add $@; }; f" | |
diff = diff --word-diff | |
dc = diff --cached | |
sl = stash list | |
sa = stash apply | |
ss = stash save | |
la = "!git config -l | grep alias | cut -c 7-" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment