Configure Git config recursively for all submodules

I need to run the command:

git config core.filemode false 

The problem is that I have several projects with at least ten submodules. For some reason, all submodules have a value set to true, so I will have to manually delete / update this configuration.

Is there a way to tell Git to set the configuration value for all submodules?

Or remove it from submodules so that saved repo parameters are not overwritten?

+5
source share
1 answer

You can use the git submodule foreach to do this: https://www.kernel.org/pub/software/scm/git/docs/v1.6.1.3/git-submodule.html

You can provide an arbitrary shell command as a parameter, in your case something like this:

 git submodule foreach --recursive git config core.filemode false 

This will be done by git config core.filemode false in each of the submodules of the current Git repository.

+6
source

All Articles