Skip to content

Instantly share code, notes, and snippets.

@seth-macpherson
Created September 4, 2015 17:11
Show Gist options
  • Save seth-macpherson/aac9de684ae7f7981958 to your computer and use it in GitHub Desktop.
Save seth-macpherson/aac9de684ae7f7981958 to your computer and use it in GitHub Desktop.
$HOME/.gitconfig
[diff]
# tool = bc3
keepBackup = false
prompt = false
# [difftool "bc3"]
# dirDiff = true
# trustExitCode = true
# prompt = false
# keepTemporaries = false
# trustExitCode = true
# keepBackup = false
[merge]
# tool = bc3
prompt = false
[mergetool]
prompt = false
keepTemporaries = false
trustExitCode = true
keepBackup = false
[alias]
# while true; do foo; sleep 2; done
diffall="!f() { git diff --name-only \"$@\" | while read filename; do `git difftool \"$@\" --no-prompt \"$filename\" &` ; done; }; f"
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
l = log --pretty=oneline -n 20 --graph --abbrev-commit
remotes = remote -vq
tags = tag -l
# Add new untracked files
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
addnew = !"git add $(git ls-files -o --exclude-standard)"
br = branch
bbd = !git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'
ci = "!f() { SHA=`git log -n1 --pretty=format:"%H"`; hub ci-status $SHA; }; f"
co = checkout
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; mate `f`"
lg = log --graph --pretty=format:'%h %Cblue%ae%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
purge = "!f() { git branch --merged edge | grep -v \"master\" | grep -v \"edge$\" | xargs git branch -d; }; f"
purge4 = "!f() { git branch --merged rails4 | grep -v \"master\" | grep -v \"edge$\" | grep -v \"rails4$\" | xargs git branch -d; }; f"
s = status --branch
compare = "!f() { hub compare `git symbolic-ref HEAD`; }; f"
mt = mergetool
rc = rebase --continue
mask = update-index --assume-unchanged
unmask = update-index --no-assume-unchanged
list-masked = "!f() { git ls-files -v | grep '^[a-z]'; }; f"
deployed-to = "!f() { git tag --contains \"$@\" | awk '/QS-(BLEEDIN|ALPHA)/{ print $0 }' | tail -1; }; f"
drop-last = "!f() { git reset --hard HEAD^; }; f"
[log]
date = relative
[format]
pretty = format:%h %Cblue%ad%Creset %ae %Cgreen%s%Creset
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[core]
# Use custom `.gitignore` and `.gitattributes`
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
editor = /usr/local/bin/mate -w
# Treat spaces before tabs, lines that are indented with 8 or more spaces, and
# all kinds of trailing whitespace as an error.
# [default] trailing-space: looks for spaces at the end of a line
# [default] space-before-tab: looks for spaces before tabs at the beginning of
# a line
# whitespace = space-before-tab,indent-with-non-tab,trailing-space
[color]
# Use colors in Git commands that are capable of colored output when
# outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.)
ui = 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
[merge]
# Include summaries of merged commits in newly created merge commit messages
log = true
# URL shorthands
[url "[email protected]:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "[email protected]:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"
[push]
default = current
[user]
name = Justin Bahr
email = [email protected]
[filter "media"]
required = true
clean = git media clean %f
smudge = git media smudge %f
[filter "hawser"]
clean = git hawser clean %f
smudge = git hawser smudge %f
required = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment