Skip to content

Instantly share code, notes, and snippets.

@schnell18
Last active December 28, 2015 23:49
Show Gist options
  • Save schnell18/7582198 to your computer and use it in GitHub Desktop.
Save schnell18/7582198 to your computer and use it in GitHub Desktop.
Useful git config to work on OSX
git config --global user.name "John Doe"
git config --global user.email "[email protected]"
git config --global core.editor vim
git config --global color.ui true
git config --global merge.tool vimdiff
git config --global push.default simple
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.dfs "diff --staged"
git config --global alias.mgf "merge --ff-only"
git config --global alias.logg "log --graph --decorate --oneline --abbrev-commit --all"
git config --global alias.logl "log --graph --decorate --oneline --abbrev-commit"
git config --global alias.logp "log --oneline --abbrev-commit"
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'
git config --global alias.desc 'describe'
git config --global core.autocrlf input # set line ending to new line
git config --global credential.helper osxkeychain # let keychain remember http(s) password
git config --global credential.helper 'cache --timeout 36000' # remember the password all day long on linux
@schnell18
Copy link
Author

Equivalent system-wide /etc/gitconfig:

[core]
    editor = vim
[color]
    ui = true
[merge]
    tool = vimdiff
[push]
    default = simple
[alias]
    co = checkout
    br = branch
    ci = commit
    st = status
    dfs = diff --staged
    mgf = merge --ff-only
    logg = log --graph --decorate --oneline --abbrev-commit --all
    unstage = reset HEAD --
    last = log -1 HEAD
    desc = describe
[credential]
    helper = cache --timeout 36000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment