Skip to content

Instantly share code, notes, and snippets.

@neotohin
Last active January 4, 2016 08:18
Show Gist options
  • Save neotohin/8594005 to your computer and use it in GitHub Desktop.
Save neotohin/8594005 to your computer and use it in GitHub Desktop.
My gitconfig
[user]
name =
email =
[alias]
st = status -sb
f = fetch
c = commit
p = pull
b = branch -ra
d = diff -b --word-diff
ds = diff --staged
dc = diff --cached
amend = commit --amend -C HEAD
undo = reset --soft HEAD^
cm = commit -m
a = add
ap = add -p #add patch chunk wise
co = checkout
ready = rebase -i @{u}
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
ls = log --pretty=format:'%Cred%h%Creset %Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --decorate --no-merges -n 20
la = "!git config -l | grep alias | cut -c 7-"
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
assumeall = "!git st -s | awk {'print ['} | xargs git assume"]
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
filemode = config core.filemode false
#list modified files in last commit
dl = "!git ll -1"
#reset commands
r = reset
r1 = reset HEAD^
r2 = reset HEAD^^
rh = reset --hard
rh1 = reset HEAD^ --hard
rh2 = reset HEAD^^ --hard
#git svn
svnr = svn rebase
svnd = svn dcommit
svnl = svn log --oneline --show-commit
lasttag = describe --tags --abbrev=0
lt = describe --tags --abbrev=0
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[giggle]
main-window-maximized = true
main-window-geometry = 0x0+0+0
history-view-vpane-position = 231
file-view-vpane-position = 323
main-window-view = HistoryView
[color]
ui = auto # covers diff = true, status = auto, branch = auto
interactive = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[diff]
algorithm = patience
[push]
default = upstream
[pull]
default = current
[core]
autocrlf = true
whitespace = cr-at-eol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment