TIL you can stop Git/VSC from staging submodule changes #6387
MightyTheArmiddilo
started this conversation in
General
Replies: 1 comment
-
|
say that again... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed that a lot of contributors of all skill levels suffer accidentally from making pull requests that edit both the main repo and a submodule. When using a command/shortcut to stage all changes, this includes changes to submodules (especially when it comes to someone forking the submodule and directing their local assets repo there). This creates unnecessary merge conflicts that could probably drive a newer contributor's sanity into the ground if they aren't experienced with submodules. According to the .gitmodules documentation, submodules have an "ignore" field with three different parameters:
(why is most of the quote in a code block-)
As an example, the .gitmodules file could go like:
I have yet to test a majority of this myself, but adding an ignore field with say dirty to .gitmodules caused any changes to a submodule to be ignored in VSC's Source Control, while still giving me the option to stage and push commits to the submodule's repository as well.
Beta Was this translation helpful? Give feedback.
All reactions