I want to fork a GitHub project to GitLab. Following the answer to similar question at https://stackoverflow.com/a/52954199/13340500 ,
I can set the original, GitHub repo as the "upstream" remote, and my GitLab repo as the "origin". Then I should be able do git pull upstream master
to pull any updates locally, and git push origin master
to push my changes to my GitLab repo.
BUT, the original GitHub repo has a number of submodules in it. Now, I'm able to recursively pull the submodules to the local, but how to push them to the GitLab? If you do, you will have them as links pointing to the original, GitHub submodules repos (and so not able to push own local changes). Of course I can reset a submodule url (to point to GitLab instead or original GitHub), but then I'll not be able to pull the changes from the original github for those submodules.
It is possible to set different urls for remote - remote "upstream" and remote "origin", but can you do something similar for the submodules? Or, is the only feasible way to keep the submodules in sync is to treat them each as a separate project, and do pull
and push
in each of them individually?