Skip to main content
  1. Notes/
  2. git/

git configuration

150 words

User specific configuration is saved in ~/.gitconfig a simple example is:

[user]
	name = Firstname Lastname
	email = firstname.lastname@example.com

A more extended configuration:

[user]
	name = Firstname Lastname
	email = firstname.lastname@example.com

[color]
	ui = true

[color "branch"]
	current = yellow reverse
	remote = green
	local = yellow

[color "diff"]
	frag = magenta bold
	new = green bold
	meta = yellow bold
	old = red bold

[color "status"]
	untracked = red
	added = yellow
	changed = green

[core]
	editor = vim

[diff]
	tool = vimdiff

[difftool]
	prompt = false

[merge]
	tool = vimdiff

[alias]
	ci = commit
	co = checkout
	d = difftool
	sr = diff remotes/origin/master..origin/master
	st = status -s
	br = branch -av
	brname = !git branch | grep "^*" | awk '{ print $2 }'
	lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
	lpg = log --pretty=format:"%H %ad %s" --date=raw

[push]
	default = simple