1

I want to duplicate a repository, that also has a submodle - which is it's own repository.

When I duplicate the top-level repository (using the method described in GitHub's help pages), only the top repository is duplicated, and the submodule is still linked to the original repository.

However, I want to (temporarily) make both repositories private and thus be able to edit both as full duplicates.

How can I do that?

Scott Weldon
  • 9,673
  • 6
  • 48
  • 67
user1914292
  • 1,586
  • 13
  • 38

2 Answers2

1

You would want to create a fork of both the repo and any Sub modules into a private repo. Then you would just remove the submodule from the original repo, then add a new submodule from your fork.

HERE's a link that covers how to fork a public repo into a new private repo.

and HERE's a great post on removing and updating submodules.

Community
  • 1
  • 1
Keif Kraken
  • 9,500
  • 1
  • 10
  • 12
  • thanks - that helped, but I ended up doing it a bit different than what it's in the links - please see my answer. Thanks again – user1914292 Oct 06 '16 at 07:46
0

For anyone running into the same problem, here's what I did:

  • duplicate the top repo in GitHub with their web form (https://github.com/new/import)
  • duplicate the submodule in GitHub with the same form
  • in the top repo: open the .gitmodules file and replace the submodule reference
  • git add .gitmodules
  • git commit & git-push

Worked like a charm.

user1914292
  • 1,586
  • 13
  • 38