2

I have Visual Studio project with two solutions. One is my current project, the other one is a submodule. Entire project is in git. I have used gitignore generated by Visual Studio for the project.

Part of the submodule is also Visual Studio solution and project settings for the submodule project. I have added this submodule to my solution but I needed to change include directories and active build fot he submodule.

If I want to commit my project, git is complaining about submodule being "dirty" and I can commit submodule or ignore it. I want to commit submodule only if source codes have changed. Is there any way how to stop git complaining about "dirty" submodule, or I have to do "ignore" every time I commit?

Martin Perry
  • 9,232
  • 8
  • 46
  • 114

1 Answers1

2

but I needed to change include directories and active build fot he submodule.

So that is why the main parent repository considers its submodule "dirty": there are pending changes in it.

If said changes are purely local to your workstation, you might consider remove them from the index consideration with git update-index --assume-unchanged <file>:

 cd /path/to/submodule
 git reset -- modified/file
 git update-index --assume-unchanged -- modified/file

That is a local workaround, to make sure those files don't show up as modified in the submodule status.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250