Skip to content

Instantly share code, notes, and snippets.

@timofurrer
Created August 29, 2013 12:35
Show Gist options
  • Save timofurrer/6377500 to your computer and use it in GitHub Desktop.
Save timofurrer/6377500 to your computer and use it in GitHub Desktop.
[user]
name = Timo Furrer
email = [email protected]
[alias]
# generic
co = checkout
br = branch
ci = commit
st = status
unstage = reset HEAD
# history
l = log --graph --pretty=format:'%Cred%h%Creset -%C(bold cyan)%d%Creset %s %C(blue)<%an>%Creset, %C(white)%cr' --abbrev-commit
la = log --graph --pretty=format:'%Cred%h%Creset -%C(bold cyan)%d%Creset %s %Cgreen(%cr) %C(blue)<%an>%Creset' --abbrev-commit --all
lsub = "!f() { if [ -z $1 ]; then echo 'Please specify a subject'; exit 1; fi; subject=$1; shift; git log --graph --all --pretty=format:'%Cred%h%Creset -%C(bold cyan)%d%Creset %s %C(blue)<%an>%Creset, %C(white)%cr' --grep=^$subject: $@; }; f"
commits-since = "!f() { git log --pretty=format:'%Cred%h%Creset -%C(bold cyan)%d%Creset %s %C(blue)<%an>%Creset, %C(white)%cr' --after=$1; }; f"
show-tree = log --graph --pretty=format:'%Cred%h%Creset -%C(bold cyan)%d%Creset %s %C(blue)<%an>%Creset, %C(white)%cr' --simplify-by-decoration --all
# open modified files with vim
em = !vi `git status | grep modified | awk '{print $3}'`
dmf = !git diff `git status | grep modified | head -n1 | awk '{print $3}'`
amf = !git add `git status | grep modified | head -n1 | awk '{print $3}'`
diffm = "!f() { git diff `git status | grep modified | head -n $1 | awk '{print $3}'`; }; f"
addm = "!f() { git add `git status | grep modified | head -n $1 | awk '{print $3}'`; }; f"
# show count of commits per author
ablame = shortlog -s -n
# diff
wdiff = diff --color-words
update = pull --rebase
# rebase and amend stash
rebaseamend = "!f() { git stash; git rebase -i HEAD~$1; git stash pop; git commit -a --amend; git rebase --continue; }; f"
[color]
ui = auto
diff = auto
status = auto
branch = auto
grep = auto
[color "status"]
added = green
changed = yellow
untracked = cyan
[color "branch"]
current = green bold
local = cyan
remote = white
[svn]
addAuthorFrom = true
useLogAuthor = true
rmdir = true
[merge]
tool = kdiff3
[credential]
helper = cache --timeout=3600
[github]
user = timofurrer
email = [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment