Pre-determine default Git Local config values

72 views Asked by At

I read this issue, but it did not answer the question.

I wanted to set "core.filemode" to false, as I share my repository with Windows and Linux (and other unix) boxes. Feeling rather clever and as though I'd learned something after researching my problem, I bravely issued:

git config --global core.filemode false

which, dutifully set the proper value in the global config file. Now, operating under the assumption that the global settings would form the basis for local settings, I cloned our central repository from Linux. Switching to Windows, I see that git thinks that all 16k files have been modified (thanks, filemode). Examining the local config file, shows that filemode is set to true (the global value is false, as I had issued the above command on both Windows and Linux prior to cloning).

Clearly, I had not learned enough.

So, my question is, where are the default settings that are dropped into the local config file stored and tuned?

1

There are 1 answers

0
Jon On

Well, @larsks provided the answer. Seems that there is no "default" config file per se, at least, not as far as affecting this setting. 'git clone' and 'git init' will probe the filesystem to determine if the setting should be on / off and set it accordingly ('true' everywhere except Windows). Not what I was hoping or expecting to hear.

So now, once I've created a clone of the repository, I issue the following:

git config --local core.filemode false

I hope this is eventually fixed as I don't believe that the binary should be forcing certain configs which the end-user must subsequently undo.