Skip to content

Preferred Git settings

richardkchapman edited this page Aug 2, 2011 · 2 revisions

On Windows, \Users\Home.gitconfig reads:

[core]
	excludesfile = .gitignore
	editor = 'C:/util/notepad++.exe' -multiInst -notabbar -nosession -noPlugin
	autocrlf = true
	whitespace = tab-in-indent
[user]
	name = Richard Chapman
	email = rchapman@hpccsystems.com
[diff]
	tool = bc2
[difftool]
	prompt = false
[difftool "bc2"]
	cmd = \"c:/program files (x86)/beyond compare 2/bc2.exe\" \"$LOCAL\" \"$REMOTE\"
[apply]
	whitespace = error

On Linux, ~/.gitconfig reads:

[user]
        email = rchapman@hpccsystems.com
        name = Richard Chapman
[core]
        autocrlf = input
        whitespace = trailing-space,tab-in-indent
[apply]
        whitespace = error

I renamed the supplied file ./.git/hooks/pre-commit.sample to pre-commit, and it now will refuse to commit any file that contains a line with leading tabs or trailing whitespace.

(Note that the bash script works on windows too)