Can i use recurseSubmodules fetch on git clone set in .gitconfig

Is there a way to set the .gitconfig to git clone to automatically add the -recurse-subodules flag? I want to add the following to .gitconfig:

[fetch] recurseSubmodules = true 

But that will not work.

 $ git clone upstream nowyprojekt2 Cloning into 'nowyprojekt2'... done. 

I need to add the -recurse-subodule flag

 $ git clone --recurse-submodule upstream nowyprojekt2 Cloning into 'nowyprojekt2'... done. Submodule 'euca2ools' (https://github.com/eucalyptus/euca2ools.git) registered for path 'euca2ools' Cloning into 'euca2ools'... remote: Counting objects: 19147, done. remote: Total 19147 (delta 0), reused 0 (delta 0), pack-reused 19147 Receiving objects: 100% (19147/19147), 22.23 MiB | 450.00 KiB/s, done. Resolving deltas: 100% (15556/15556), done. Checking connectivity... done. Submodule path 'euca2ools': checked out '12c358cd27ff652cb144de124bb5472a74145277' 

My git version:

 $ git --version git version 2.1.0 
+4
source share
1 answer

No, this is not possible, even in the latest release of Git 2.5, released today.

This leaves you with an alias (or Git) workaround to replace git clone --recursive single command (similar to setting the default flags for git clone --recursive commands ").

+2
source

All Articles