In my software project I am using a submodule which was posted by somebody else. I now want to edit the submodule so that it works in the context of my larger project, and push the changes to my own repository. How do I do that?
I tried creating a new branch inside the submodule, switching to it, and pushing the changes. But this seems to want to overwrite the original submodule repo, which I cannot do. I also tried git submodule update --remote --merge and then pushed the changes, but that broke the submodule in that the reference to the original submodule was lost and the folder empty.
I also tried following the instructions here add modified git submodule which is not owned which instructs you to fork the submodule and use the fork as the source for your submodule, but after doing that and checking the folder, it is empty.
Thanks for the help.