Make change to a git submodule, and keep the changes
git, git-submodules
Solution
I think you need to relax the 'no commit to submodule' constraint. There are two options:
- Commit your submodule changes to a submodule branch. It is your team's branch and it is where your team put your submodule changes. When somebody clones the super project and updates the submodule they get the content of your team's branch.
- Clone the submodule repository 'right next to' your super project repository and initialize the submodule to point to your clone. Then when you commit changes to the submodule they are committed to your clone. Anybody who clones the super project gets submodule content from your submodule clone.
Otherwise, I don't see a way to achieve your desire.
Problem
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: - git clone foo; - cd foo; - git submodule init; - git submodule update; - cd path/to/submodule; - git checkout master; - Make changes to the submodule - git commit -am "Something"; - git push origin (the superproject); Then when I clone the superproject in another computer (up to step 4), I want those changes to be saved, in the superproject.