My question is somewhat related to another SO question I’ve asked: Refreshing the latest git submodule in repo
I’ve now made changes to the submodule after pulling the latest changes but I don’t want to push these upstream to the original submodule repo. I would, however, like to push these changes to the main repo (separate from the submodule) that the rest of project uses.
What’s the best way to achieve this?
You should not pollute the top level repo with code that belongs in the submodule. What you can do though is change the url in the config of where the submodule will push to. As long as you don’t run
git submodule init, you can keep pushing and pulling to the alternate location. Even git submodule commands will respect the setting.