In the following we see that Git set ignorecase to true by default despite my .gitconfig configuration.
$ mkdir foo && cd foo && git init Initialized empty Git repository in /cygdrive/c/Users/nowox/home/git/foo/.git/ $ cat .git/config | grep ignore ignorecase = true How can I tell Git to set ignorecase to false by default for new repositories?
I have put this config file in $GIT_TEMPLATE_DIR (/usr/share/git-core/templates):
[core] ignorecase = false repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true But it still doesn't work. It seems my config file is erased by Git...
Full Example
~/test $ git init Initialized empty Git repository in /cygdrive/c/test/.git/ ~/test $ cat .git/config [core] ignorecase = true repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ~/test $ cat /usr/share/git-core/templates/config [core] ignorecase = false repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true It looks it doesn't work. Both config files are different:
~/test $ diff /usr/share/git-core/templates/config .git/config 2,5c2,5 < ignorecase = false < repositoryformatversion = 0 < filemode = true < bare = false --- > ignorecase = true > repositoryformatversion = 0 > filemode = true > bare = false It is the same if I declare the GIT_TEMPLATE_DIR variable:
~/test $ rm -rf .git ~/test $ GIT_TEMPLATE_DIR=/usr/share/git-core/templates git init . Initialized empty Git repository in /cygdrive/test/.git/ ~/test $ cat .git/config [core] ignorecase = true repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true
git init foo && cd $_.$_expands to the last parameter to the previous command.