Ignore submodule changes when committing changes


I'm working on a project that contains a git submodule. I make a new branch in the submodule to make some changes. Then I try to commit my changes, but under the change list, the submodule is listed. If I commit and push, the submodule branch is changed for everyone using the repo, not just me. I can deselect the submodule in the change list, in which case the branch change is not pushed to the repo. Is there a way I can do this without deselecting this on every commit? I tried adding the submodule directory to the gitignore and that had no effect. 


There is a meta issue to properly support git submodules, please see https://youtrack.jetbrains.com/issue/IDEA-64024.

Do you have this submodule configured a separate git root in IDEA?


Yes, it properly listed in the version control directory mappings pane.


If you make a commit in submodule, the submodule file changes in the main repository, and AFAIK there is no way to ignore this change in Git. You'll see this file as changed in git status in the command line as well, not only in IDEA. 


Please sign in to leave a comment.