Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git global core.fileMode false overridden locally on clone

Tags:

git

config

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?

like image 825
Cyril CHAPON Avatar asked May 22 '15 08:05

Cyril CHAPON


2 Answers

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).

like image 120
torek Avatar answered Oct 24 '22 01:10

torek


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

like image 42
tst Avatar answered Oct 24 '22 02:10

tst