Moving from Private GitHub Repo to Public and Private

I've developed a customer project using a private repo at GitHub. What we want to do now is to open a certain part of it and produce an open source version of the project. The idea is that the customer's version will be built upon this one. Any changes made to the open source version should flow to the private one as well.

Now, the problem is that I cannot just set the current GitHub repo visible to all. There are certain pieces of code that should remain available only to the customer. So, to the actual set of questions:

  1. Is it possible to set up a pair of GitHub repos so that the parent is public while the fork remains private?
  2. Can I erase some files and their history from the repo entirely? (If 1. is possible, I could just add them there again.)

I guess I could start the repo from scratch and then work based on that but in that case I would lose some valuable history information.

Any ideas are appreciated. If needed I can provide you some more detail.

Upvotes: 3

Views: 5054

Answers (2)

david
david

Reputation: 33537

You could try separating the project into two, then use git submodule to connect them.

The parent project which is private could hold a submodule project which is public.

See http://help.github.com/submodules/ for more details.

Upvotes: 4

Benedikt Waldvogel
Benedikt Waldvogel

Reputation: 12866

Concerning the 2nd part of your question:

You can use git filter-branch to remove files or entire directories from your history.

Also see the question: How do I remove sensitive files from git's history.

Upvotes: 4

Related Questions