Skip to content

Instantly share code, notes, and snippets.

@greenbicycle
Last active August 11, 2017 16:34
Show Gist options
  • Save greenbicycle/8e07706408138bd0495b to your computer and use it in GitHub Desktop.
Save greenbicycle/8e07706408138bd0495b to your computer and use it in GitHub Desktop.
My basic gitconfig file.
[user]
name = %%name%%
email = %%email%%
[core]
autocrlf = input
safecrlf = true
pager =
excludesfile = %%gitignore_global%%
ignorecase = false
[alias]
co = checkout
ci = commit
staged = diff --staged
st = status
br = branch
hist = log --color --pretty=format:\"%h %ad | %s%d [%an]\" --date=relative
oneline = log -n 10 --oneline --format=format:'%C(bold cyan)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
type = cat-file -t
dump = cat-file -p
unmerged = diff --name-only --diff-filter=U
merge = merge -Xignore-all-space
[push]
default = upstream
[filter "media"]
required = true
clean = git media clean %f
smudge = git media smudge %f
[color]
ui = true
[color "branch"]
current = blue
local = cyan bold
remote = green bold
[color "diff"]
meta = white
frag = red bold
old = yellow dim
new = green bold
whitespace = white reverse
[color "status"]
added = green
changed = yellow
untracked = red
branch = magenta

Copy this file to ~/.gitconfig and replace the following:

%%name%% with your name (no quotes)

%%email%% your email address (no quotes)

%%gitconfig_global%% - the global gitignore file. It is usually named ~/.gitignore_global

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