Reputation: 4319
I've cloned a git submodule of one of my libraries into a project I'm working on. The thing is that, after cloning, I need to change some lines in the cloned submodule, but I don't want to push those changes into the original repository.
I want those changes to stay in the superproject. Is this possible? How can I achieve that?
EDIT: As @GoZoner said, basically its:
Then when I clone the superproject in another computer (up to step 4), I want those changes to be saved, in the superproject.
Upvotes: 45
Views: 16425
Reputation: 70145
I think you need to relax the 'no commit to submodule' constraint. There are two options:
Otherwise, I don't see a way to achieve your desire.
Upvotes: 16
Reputation: 129566
You can checkout a separate branch for your changes. Don't push that branch up. Changes that you do want to push, make that on one of the original branches. Merge that branch into your special branch that you don't push up. Don't do any other work on your special branch as you would then have to merge the other way. You can do that but it gets complicated.
Upvotes: 0