Global Git Config

The following is a nice start to your global git config. place the code in your $HOME/.gitconfig file. Be sure to replace the following tags with your actual information.

  • <your.email@server.com>
  • <Your Name>
  • <YOUR HOME DIR>
# This is Git's per-user configuration file.
[user]
        email = <your.email@server.com>
        name = <Your Name>
[push]
        default = simple
[merge]
        tool = opendiff
[alias]
        co = checkout
        br = branch
        ci = commit
        st = status
        df = diff
        dt = difftool --dir-diff
        l = log --graph --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(blue)- %an%Creset %C(green)%ar%Creset'
        permission-reset = !git diff -p -R | grep -E \"^(diff|(old|new) mode)\" | git apply
[core]
        editor = /usr/bin/vim
        excludesfile = /<YOUR HOME DIR>/.gitignore_global
[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
[commit]
        template = /<YOUR HOME DIR>/.stCommitMsg
comments powered by Disqus