I have a git repository "R", which used to have a lot of submodules.
Now several things happend in this order:
Person "P" created a fork "F" of the repository and made some changes to it.
In the meantime, the submodules were removed in repository R.
P creates a pull request for F, to merge their changes into R. F still has the submodules, while R does not.
If I were to just merge the changes, it would re-add the submodules to the repository, which I then would have to remove again. I.e. in the git history, submodules would be removed, then added again and then removed again. I could see this causing a lot of problems if someone tried to pull the latest changes. If possible, I would like to merge the changes without the submodules being re-added in the history.
What would be the best way of handling this? My idea currently is this:
Would that work, or would that still cause the submodules to be re-added if someone pulls the changes?
Your assumption
If I were to just merge the changes, it would re-add the submodules ...
is not correct. Two cases are possible:
git merge
will keep the deletion of the submodule.git merge
will throw a conflict and you would have to resolve it: Keep the submodule deleted or use the new version from F.Regarding your idea you need to make sure you create the branch B at a commit where the submodule was not yet deleted. Ideally you would use the commit that F based his branch on.