# [ISSUE] `git submodule update --init --recursive` does ignore `fetchRecurseSubmodules` flag in `.gitmodules` and in `.git/config`

2 messages from 2024-06-10 to 2024-06-10. Participants: Andry, brian m. carlson.
Thread: https://gitlist.dev/t/61611

## Andry, 2024-06-10 01:19

Subject: [ISSUE] `git submodule update --init --recursive` does ignore `fetchRecurseSubmodules` flag in `.gitmodules` and in `.git/config`
Message-ID: <153002248.20240610041910@inbox.ru>
URL: https://gitlist.dev/e/153002248.20240610041910%40inbox.ru

```
Hello Git,

First discovered here: https://github.com/gitextensions/gitextensions/issues/11783
Another discussion: https://stackoverflow.com/questions/58403616/does-git-submodule-update-recursive-override-fetchrecursesubmodules
Manual: https://git-scm.com/docs/gitmodules#Documentation/gitmodules.txt-submoduleltnamegtfetchRecurseSubmodules
---

If use a recursive submodule, for example:

A->B->A->...

And call submodules Update on A, then the Update does ignore the flag and keeps fetch recursively with the error at the end:

>  fatal: Failed to recurse into submodule path ...

Is that supposed to work this way or is an bug?


```

## brian m. carlson, 2024-06-10 22:02

Subject: Re: [ISSUE] `git submodule update --init --recursive` does ignore `fetchRecurseSubmodules` flag in `.gitmodules` and in `.git/config`
Message-ID: <Zmd36kkRM543zlQs@tapette.crustytoothpaste.net>
URL: https://gitlist.dev/e/Zmd36kkRM543zlQs%40tapette.crustytoothpaste.net
In-Reply-To: <153002248.20240610041910@inbox.ru>

```
On 2024-06-10 at 01:19:10, Andry wrote:
> Hello Git,
> 
> First discovered here: https://github.com/gitextensions/gitextensions/issues/11783
> Another discussion: https://stackoverflow.com/questions/58403616/does-git-submodule-update-recursive-override-fetchrecursesubmodules
> Manual: https://git-scm.com/docs/gitmodules#Documentation/gitmodules.txt-submoduleltnamegtfetchRecurseSubmodules
> ---
> 
> If use a recursive submodule, for example:
> 
> A->B->A->...
> 
> And call submodules Update on A, then the Update does ignore the flag and keeps fetch recursively with the error at the end:
> 
> >  fatal: Failed to recurse into submodule path ...
> 
> Is that supposed to work this way or is an bug?

Yes, it's working as designed.  From the documentation,
`fetchRecurseSubmodules` only applies to `git fetch` and `git pull`, not
`git submodule`.  Even if it did, you still specified recursive
behaviour in a command-line option, and command-line operations override
the configuration.

If you don't want recursion, you'll need to skip the `--recursive` flag.
-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA

```
