1

When I run git commit -a I would like it to skip committing changes to submodules.

(incase it matters, I want to have the latest version of all submodules but not commit these changes to the remote git repository).

How can this be done locally, so I can update submodules, but not commit changes to them?

So this works for eg:

git submodule foreach git origin master

Note that this seems similar to this question, but there seems some slight difference and the accepted answer doesn't work.

ideasman42
  • 35,906
  • 32
  • 172
  • 287

1 Answers1

0

Check if the setting diff.ignoreSubmodules would help

 cd /path/to/my/repo
 git config diff.ignoreSubmodules all

Then a add+commit should only include files of the main repo.

VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755