Is it possible to change few files in submodule without creating fork?
Asked Answered
R

1

6

I'm creating cocos2d-x game and include upstream cocos fom git (it include some critical fixes and features). However, using SDKBOX require patching some cocos files (which is in submodule).

Is it possible to include those files (or even better patches to them) to main repository? Of course, it is possible to fork cocos2d-x repository and patch them there, but it makes updates more complicated (create pull request and merge it at first).

Regulation answered 18/7, 2018 at 15:42 Comment(0)
S
5

Is it possible to change few files in submodule

Yes, but that means the parent repository will reference a new SHA1 representing the root tree of that submodule.
If you push the main repo without pushing the submodule one, anyone cloning the parent repo won't be able to update/checkout the submodule, because of an unknown SHA1.

So you need to be able to push back the fix done in a submodule to its upstream repository.

without creating fork?

If you own the upstream repository, you can push back directly to it.
But if not, a fork, or at least a branch new repository to which you can push back is still needed. Provided you update the submodule URL.

I would say this is still the recommended approach, even though it will involve later on some pull request.

Sidnee answered 21/7, 2018 at 15:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.