gitconfig

Git global core.fileMode false overridden locally on clone


Reading this, I was able to configure both globally and locally my fileMode configuration to false.

However, when I git clone, Git keeps initializing the projects with local configuration forced to fileMode true, so that it overrides my global false. As a consequence I have, for every project, to either remove the local configuration or set it to false manually, which entirely lose the point of having a global configuration.

How can I prevent Git from setting, by default, on every project, this configuration locally? Is that driven by another configuration variable? By the server?


Solution

  • Clone, like init, always sets a local core.filemode when it creates a new repository. See my answer to this question for details. The only way to clobber the local setting after a clone is to do it manually (e.g., by having a wrapper command that does the clone, then goes into the clone and removes the setting). Or, as in tst's answer and Steve Benner's comment, add -c core.filemode=false to your git clone (be sure to put the -c option after the verb clone).