3

I'm working on my own project which has two parts:

A. kernel/generic code (public part)

B. code which works with proprietary protocol etc (private part, available for me and a few authorized persons)

I want repository hosting (maybe github, assembla, ...) which allows working in public and private branches in the same repository.

I don't want two repositories because I'm actively working on both parts and I want to avoid diverged repositories.

Which solution is available for me?

uintptr_t
  • 293
  • 1
  • 3
  • 9

1 Answers1

3

which allows working in public and private branches in the same repository.

That doesn't seem compatible with how Git works: if you have access to a repo, you can clone all its content (including the branches).

A Git Hosting service like BitBucket or GitLab allows you to protect a branch (meaning you cannot push back). But you would still be able to see its content.
Even Gitolite doesn't prevent read-access at a branch level.

So two separate repos are still the best approach, with the repo A (kernel) declared as a submodule of repo B.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • It does not seem you want submodules either - git does not tightly associate submodules to your repo. – Michael Apr 23 '14 at 12:43
  • @Michael it seems to be Git does tightly associate a submodule to a main repo, through a gitlink: http://stackoverflow.com/a/23151138/6309 – VonC Apr 23 '14 at 12:45
  • I think we just have different notions of tightly associate, the questions refers to not working in two git repos, submodules are effectively two git repos - but there is no way to satisfy a public and private repo/branch in git as far as I know - and there does not need to be. – Michael May 01 '14 at 17:31
  • @Michael I agree. My point is: given the question premiss, you cannot use just one repo, hence the need of two repos and a strong link between the two: that implies using a submodule. – VonC May 01 '14 at 18:57