Skip to content

Instantly share code, notes, and snippets.

@andrewmallis
Last active March 18, 2016 23:32
Show Gist options
  • Save andrewmallis/c6a0f427577e8adb492e to your computer and use it in GitHub Desktop.
Save andrewmallis/c6a0f427577e8adb492e to your computer and use it in GitHub Desktop.
kala.gitconfig
[user]
name = XXX
email = [email protected]
[github]
user = XXX
token = XXX
[core]
excludesfile = ~/.gitignore
# excludesfile = ~/.gitignore_global
pager = less -FRSX
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
editor = nano
mergeoptions = --no-commit --no-ff
[mergetool]
keepBackup = true
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[branch]
autosetuprebase = always
[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true
[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
[alias]
co = checkout
st = status
ci = commit
aa = add -A
br = branch
cam = commit -am
sb = show-branch
branches = branch -a
# usage example: git w -n5
w = whatchanged
# add all changed (but not new) files to stage (index):
au = add -u
undo = reset --soft HEAD^
graph = log --graph --oneline --decorate
info = config --list
pop = !git stash apply && git stash clear
summary = log --oneline
tags = tag -n1 -l
dc = diff --cached
last = log -1 HEAD
lg = log --graph --decorate --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
tree = log --graph --decorate --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
today = diff --stat @{yesterday}..HEAD
# given a string for an author, try to figure out full name and email:
whois = !sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\
\" --author=\"$1\"' -
# given any git object, try to show it briefly
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
# Search for a given string in all patches and print commit messages
# example: search for any commit that adds or removes string "foobar"
# git searchcommits foobar
# example: search commits for string "foobar" in directory src/lib
# git searchcommits foobar src/lib
# example: search commits for "foobar", print full diff of commit with 1 line context
# git searchcommits foobar --pickaxe-all -U1 src/lib
searchcommits = "!f() { query=\"$1\"; shift; git log -S\"$query\" \"$@\"; }; f \"$@\""
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment