# "git add -A" should respect "ignore = all" in ".gitmodules"

2 messages from 2024-11-11 to 2026-02-06. Participants: Oliver Kopp, Claus Schneider.
Thread: https://gitlist.dev/t/62476

## Oliver Kopp, 2024-11-11 09:13

Subject: "git add -A" should respect "ignore = all" in ".gitmodules"
Message-ID: <CAA55TJo_AxC8NPbaXAi7fW+XfbxnXvVKT71x3TkyCt71+vQ-Vw@mail.gmail.com>
URL: https://gitlist.dev/e/CAA55TJo_AxC8NPbaXAi7fW%2BXfbxnXvVKT71x3TkyCt71%2BvQ-Vw%40mail.gmail.com

```
I have a repository with "ignore = all" set in ".gitmodules"

[submodule "abbrv.jabref.org"]
  path = buildres/abbrv.jabref.org
  url = https://github.com/JabRef/abbrv.jabref.org.git
  ignore = all
  shallow = true

"git status" reports no changes

Now, I do

1. "echo test >> CHANGELOG.md"
2. "git status"
3. See that only "CHANGELOG.md" has modifications
4. "git add -A"
5. See that "CHANGELOG.md" and "buildres/abbrv.jabref.org" has modifications.

This is consistent to the documentation:

A. "ignore = all" is instructing "git status" (and git diff family)
only (https://git-scm.com/docs/gitmodules/2.10.5#Documentation/gitmodules.txt-submoduleltnamegtignore)
B. "git add -A" adds "all files in the entire working tree"
(https://git-scm.com/docs/git-add#Documentation/git-add.txt--A)

However, I think this is not consistent in itself: The files output by
"git status" should match the files being handled by "git add -A".

I am aware of the workaround to use "git update-index
--assume-unchanged path/to/submodule" for each ignore sub module.

One can try out at git@github.com:JabRef/jabref.git.

StackOverflow question on this: https://stackoverflow.com/q/66773544/873282

My wish: "git add -A" should respect "ignore = all" in ".gitmodules"

WDYT?

Cheers,

Oliver

```

## Claus Schneider, 2026-02-06 12:53

Subject: Re: "git add -A" should respect "ignore = all" in ".gitmodules"
Message-ID: <CA+GP4bqVephG4creBWsqt3ez3UT_zLFb3EP3vbGouC41O4yv0A@mail.gmail.com>
URL: https://gitlist.dev/e/CA%2BGP4bqVephG4creBWsqt3ez3UT_zLFb3EP3vbGouC41O4yv0A%40mail.gmail.com
In-Reply-To: <CAA55TJo_AxC8NPbaXAi7fW+XfbxnXvVKT71x3TkyCt71+vQ-Vw@mail.gmail.com>

```
Hi ..
Please have a look here: https://github.com/gitgitgadget/git/pull/1987 .

Would this solve the problem?

Best regards
Claus Schneider

On Mon, Nov 11, 2024 at 10:13 AM Oliver Kopp <kopp.dev@gmail.com> wrote:
>
> I have a repository with "ignore = all" set in ".gitmodules"
>
> [submodule "abbrv.jabref.org"]
>   path = buildres/abbrv.jabref.org
>   url = https://github.com/JabRef/abbrv.jabref.org.git
>   ignore = all
>   shallow = true
>
> "git status" reports no changes
>
> Now, I do
>
> 1. "echo test >> CHANGELOG.md"
> 2. "git status"
> 3. See that only "CHANGELOG.md" has modifications
> 4. "git add -A"
> 5. See that "CHANGELOG.md" and "buildres/abbrv.jabref.org" has modifications.
>
> This is consistent to the documentation:
>
> A. "ignore = all" is instructing "git status" (and git diff family)
> only (https://git-scm.com/docs/gitmodules/2.10.5#Documentation/gitmodules.txt-submoduleltnamegtignore)
> B. "git add -A" adds "all files in the entire working tree"
> (https://git-scm.com/docs/git-add#Documentation/git-add.txt--A)
>
> However, I think this is not consistent in itself: The files output by
> "git status" should match the files being handled by "git add -A".
>
> I am aware of the workaround to use "git update-index
> --assume-unchanged path/to/submodule" for each ignore sub module.
>
> One can try out at git@github.com:JabRef/jabref.git.
>
> StackOverflow question on this: https://stackoverflow.com/q/66773544/873282
>
> My wish: "git add -A" should respect "ignore = all" in ".gitmodules"
>
> WDYT?
>
> Cheers,
>
> Oliver
>

```
