Git: Config

By Xah Lee. Date: . Last updated: .

Here's the most important and practical git config.

Setup Editor for Commit Message

git config --global core.editor emacs
setup text editor, for writing commit messages.

Why should you setup an editor?

when you do commit, example:

git commit -m "message"

If you have multiple lines for message or if it contains Unicode characters, the shell may not recognize them.

it's better to setup a text editor, so that git will launch your editor and let you type the message.

Always Use Color

git config --global color.ui true
set git to always use colored output.

Output All at Once (No Pager)

git config --global core.pager ""
Make git not use a pager. That is, make git display everything in one shot.

Global Git Config Location

global git config is stored at ~/.gitconfig

here's a sample git config file content.

[user]
	name = Xah Lee
	email = abc@example.org
[core]
	symlinks = false
	editor = emacs
	autocrlf = false
	pager =
[i18n]
	commitEncoding = utf-8
	logOutputEncoding = utf-8
[color]
	ui = true

git FAQ