'Git global core.fileMode false overridden locally on clone
Reading this, I was able to configure both globally and locally my fileMode
config to false.
However, when I git clone
, git keeps initializing the projects with local config forced to fileMode true
, so that it overrides my global false
. As a consequence I have, for every project, to either remove the local config or set it to false
manually, which entirely lose the point of having a global config.
How can I prevent git from setting, by default, on every project, this config locally? Is that driven by another config variable? By the server?
Solution 1:[1]
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
).
Solution 2:[2]
git clone --config core.filemode=false YOUR_REPOSITORY
for further information refer to the usage information of git clone, or just enter:
git clone
without any arguments
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | tst |