1

I've a repo with some external git repos as submodules. I made some changes in these submodules, but I've no way of pushing them upstream. How do I commit my changes to my repo without needed to push upstream? I'm ok with with having an out-of-sync copy of submodules. One way is to clone external repos as just remove the .git directory to treat them just as directories, but I already have a submodule setup and I'd like to avoid that if possible.

pbp
  • 1,461
  • 17
  • 28

1 Answers1

1

You can commit the submodule changes to your local repo, but anyone else cloning it won't see those changes unless you push them upstream. That being said, you don't necessarily have to push those changes upstream to the same place you got them. You can clone a copy of the submodule on the same server you keep your main repo and push your changes to that copy instead.

The only change you have to make is that you'll have to re-init the submodule as coming from your server, rather than the original repo.

Jonathan Wren
  • 3,662
  • 23
  • 29
  • Can you give an example, how to reinit external submodules to be able to push to them, instead of pushing upstream? – pbp Feb 25 '13 at 20:57
  • You can just edit the `.gitmodules` file and then run `git submodule sync` (http://stackoverflow.com/questions/913701/changing-remote-repository-for-a-git-submodule). – Jonathan Wren Feb 25 '13 at 21:00