1

We have a main git repo in which we have added another repo as submodule. We have configured to ignore any changes to this submodule by setting ignore=all in the .gitmodules file with the expectation that any changes within the submodule (commits or files) never show up as changes when adding files to staging.

What we are observing is that even though the submodule doesn't show up as changed when we run git status, using git add -A adds the submodule as a change if there is difference in the commits in the submodule between the current branch and master.

Is there a way to avoid the submodule from being added to staging/commit when using git add or git commit -am?

Darshan
  • 181
  • 1
  • 10
  • I am attempting the same thing and see the same results: `git add .` includes changes to the submodule. In my case, I'm trying to [replace a Git submodule with a symlink](https://stackoverflow.com/q/21077493/970346). The answers indicate that this workflow is not well supported. – Stephen Niedzielski Mar 24 '21 at 03:13

0 Answers0