Unusual Subroutines

The blog and musings of Christopher Allen-Poole

My Gitconfig

My current Gitconfig file, because why not?

[user]
    name = "Christopher Allen-Poole"
    email = "chris.allen-poole@omnigon.com"
[core]
    excludesfile = /Users/chris/.gitignore_global
    fileMode = false
[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
[alias]
    # These are all simply "shorter versions" of existing commands
    stat = status
    st = status
    co = checkout
    st = status -s
    ci = commit
    com = commit
    pul = pull

    # These are invaluable shortcuts
    to = reset --hard
    head = "!git rev-parse HEAD"
    branch-name = "!git rev-parse --abbrev-ref HEAD"
    ppush = "!git push -u origin `git rev-parse --abbrev-ref HEAD`"
    assume = update-index --assume-unchanged
# Reverse the above
    unassume = update-index --no-assume-unchanged
# Show the files that are currently assume-unchanged
    assumed = "!git ls-files -v | grep ^h | cut -c 3-"

# Checkout our version of a file and add it
    ours = "!f() { git checkout --ours $@ && git add $@; }; f"
# Checkout their version of a file and add it
    theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"

[diff]
    algorithm = patience


[push]
    default = simple
[filter "lfs"]
    clean = git lfs clean %f
    smudge = git lfs smudge %f
    required = true
blog comments powered by Disqus