git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
OKOliver Kopp <kopp.dev@gmail.com>
Date
Nov 11, 2024, 09:13 UTC
Message-ID
<CAA55TJo_AxC8NPbaXAi7fW+XfbxnXvVKT71x3TkyCt71+vQ-Vw@mail.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
Next: Claus Schneider
Message 1 of 2 in “"git add -A" should respect "ignore = all" in ".gitmodules"”
  1. Oliver KoppNov 11, 2024
  2. Claus SchneiderFeb 6, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.