Skip to content

Instantly share code, notes, and snippets.

@dan-turner
Last active May 17, 2016 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dan-turner/172e527193e65e41e3d5b0d2130bb0f5 to your computer and use it in GitHub Desktop.
Save dan-turner/172e527193e65e41e3d5b0d2130bb0f5 to your computer and use it in GitHub Desktop.
.gitconfig for Mac
[hub]
protocol = https
[user]
name = ### Name goes here ###
email = ### Email goes here ###
[credential]
helper = osxkeychain
[alias]
co = checkout
promote = !$ZSH/bin/git-promote
wtf = !$ZSH/bin/git-wtf
rank-contributors = !$ZSH/bin/git-rank-contributors
count = !git shortlog -sn
st = status
ci = commit
br = branch
co = checkout
cod = checkout develop
com = checkout master
fe = fetch --all
bn = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD`
rb = rebase
rbm = rebase master
rbu = !sh -c 'BRANCH=$(git bn) && git rb upstream/$BRANCH'
rbum = rebase upstream/master
pr = !sh -c 'BRANCH=$(git bn) && git co $0 && git fe && git merge --ff-only origin/$0 && git co $BRANCH && git rb $0'
prm = !git pr master
df = diff
who = shortlog -s --
hr = reset --hard
hro = !sh -c 'BRANCH=$(git bn) && git hr origin/$BRANCH'
hru = !sh -c 'BRANCH=$(git bn) && git hr upstream/$BRANCH'
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
upstream = !sh -c 'BRANCH=$(git bn) && git rev-parse --abbrev-ref $BRANCH@{upstream}'
q = !sh -c 'BRANCH=$(git bn) && UPSTREAM=$(git upstream) && git lg $UPSTREAM..$BRANCH'
new = !sh -c 'BRANCH=$(git bn) && UPSTREAM=$(git upstream) && git lg $BRANCH..$UPSTREAM'
rbc = rebase --continue
mt = mergetool
unstage = reset HEAD $1
stage = add -A
ff = !sh -c 'UPSTREAM=$(git upstream) && git merge --ff-only $UPSTREAM'
nuke = !git clean -dxf && git checkout -f
configpr = !sh -c 'git config --local --add remote.upstream.fetch +refs/pull-requests/*:refs/remotes/upstream/pull-requests/*'
copr = !sh -c 'git fetch upstream pull-requests/$0/from && git checkout pull-requests/$0/from'
ex = !\"C:/Program Files (x86)/GitExtensions/GitExtensions.exe\" browse %CD% &
[color]
diff = auto
status = auto
branch = auto
ui = true
[core]
excludesfile = ~/.gitignore
editor = vim
[apply]
whitespace = nowarn
[mergetool]
keepBackup = false
bc3 = trustExitCode
bcomp = trustExitCode
[difftool]
prompt = false
[help]
autocorrect = 1
[push]
# See `git help config` (search for push.default)
# for more information on different options of the below setting.
#
# Setting to git 2.0 default to suppress warning message
default = simple
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[diff]
tool = sourcetree
[merge]
tool = sourcetree
conflictstyle = diff3
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /opt/homebrew-cask/Caskroom/sourcetree/2.0.5.5/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment