Skip to content

Instantly share code, notes, and snippets.

@simon-johansson
Last active October 13, 2015 22:47
Show Gist options
  • Save simon-johansson/4267349 to your computer and use it in GitHub Desktop.
Save simon-johansson/4267349 to your computer and use it in GitHub Desktop.
Git: My Git aliases and user preferences
[user]
name = Simon Johansson
email = [email protected]
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = red reverse
local = blue
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[core]
excludesfile = c:/Users/Simon/.gitignore_global
[alias]
st = status -s
cl = clone
ci = commit
cm = commit -m
cma = commit -a -m
ca = commit --amend
amend = commit --amend
caa = commit -a --amend -C HEAD
filelog = log -u
fl = log -u
ai = add --interactive
co = checkout
br = branch
#"!git branch -ra | grep -v done"
bra = branch -ra
#list commands
le = log --oneline --all --graph --decorate
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
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
lc = "!f() { git ll "$1"^.."$1"; }; f"
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
#list all aliases
la = "!git config -l | grep alias | cut -c 7-"
diff = diff --word-diff
d = diff --word-diff
ds = diff --staged
#list modified files in last commit
dl = "!git ll -1"
#diff last commit
dls = diff --staged HEAD^
dr = "!f() { git diff "$1"^.."$1"; }; f"
diffr = "!f() { git diff "$1"^.."$1"; }; f"
branch = branch -ra
[credential]
helper = cache --timeout=3600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment