views:

59

answers:

3

How would you setup an code repository where you have a proprietary version and an open source version, say like Chrome and Chromium?

With Git, would you use two branches or two repositories?

How would you keep the "private" version up to date with the open source one?

+1  A: 

I would suggest two different repositories rather than branches. git pull and/or push will help you move changes from open source repo to proprietary repo.

apsivam
Thanks, there is the local copy of the open source repository, which makes things a bit confusing because I think it was understood as another repository. What I was wondering was do you keep two unique repositories locally (one of which is the local copy of the open source repo), or would it be feasible to have the "proprietary" version as a long running branch of your local copy of the Open Source repository (to which you have write access, as the project maintainer).
faB
+1  A: 

If it were me, I would have two repositories. This way, you can have different permissions on each - public read access for the open source version and read/write for developers only on the "private" one.

To keep the private version up to date, I would set up a remote on the private version repository which points to the public version repository. This would allow you to pull or rebase changes from there onto the private one. This does however make the assumption that changes will not conflict (i.e. the private version feature-set is a super-set of the public version, rather than a divergence).

Splash
Hmm, I see so you'd use the local copy as the "proprietary" version (to use my example above), except perhaps in a special branch, so that you also have a local master branch from the remote open source repository. Then you can push the "proprietary" version to the live site, or deploy by other means, from a checkout of the proprietary branch.
faB
+1  A: 

Using your 2 repositories as git submodules, and additional meta-repository to track versions of both private and open-source repos.

bialix
Ihteresting, what's a "meta repository"? (I'm fairly new to Git)
faB
Sorry, perhaps my coined term is not quite correct. By "meta" I meant parent repository that contains 2 other repos (public and private) as submodules.
bialix