Skip to content

Instantly share code, notes, and snippets.

@ccashwell
Last active December 16, 2015 16:09
Show Gist options
  • Save ccashwell/5460652 to your computer and use it in GitHub Desktop.
Save ccashwell/5460652 to your computer and use it in GitHub Desktop.
Git configuration including several shortcuts and helpers
[core]
excludesfile = ~/.gitignore_global
excludesfile = ~/.gitignore
# When paging to less:
# * -x2 Tabs appear as two spaces
# * -S Chop long lines
# * -F Don't require interaction if paging less than a full screen
# * -X No scren clearing
# * -R Raw, i.e. don't escape the control characters that produce colored output
pager = less -FXRS -x2
whitespace = space-before-tab tab-in-indent trailing-space
[rebase]
autosquash = true
[alias]
st = status
di = diff
co = checkout
ci = commit
br = branch
sta = stash
llog = log --date=local
slog = log --format=oneline
lol = log --graph --decorate --oneline
lola = log --graph --decorate --oneline --all
# Log of changes unique to the current branch
blog = log origin/master... --left-right
# Log with tree output
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
# Full log
flog = log --pretty=fuller --decorate=full
st = status
ds = diff --staged
fixup = commit --fixup
squash = commit --squash
# Show the upstream branch name
upstream-branch = rev-parse --symbolic-full-name --abbrev-ref @{u}
unstage = reset HEAD
# Rebase onto origin/master
rum = rebase master@{u}
[color]
branch = auto
diff = auto
interactive = auto
status = auto
[format]
# TODO: Sometimes this log format + log lines conflict with the less -F option
pretty = %Cred%h%Creset %s %C(bold blue)<%an>%Creset %Cgreen[%ar]%Creset
[color "branch"]
current = green bold
local = green
remote = red bold
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = green bold
changed = yellow bold
untracked = red
[color "sh"]
branch = yellow
[push]
# 'git push' should only do the current branch, not all
default = current
[branch]
# always setup 'git pull' to rebase instead of merge
autosetuprebase = always
[diff]
renames = copies
mnemonicprefix = true
tool = Kaleidoscope
[rerere]
enabled = true
[user]
email = ccashwell@gmail.com
initials = cc
name = Chris Cashwell
[difftool "Kaleidoscope"]
cmd = ksdiff-wrapper git \"$LOCAL\" \"$REMOTE\"
[difftool]
prompt = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment