Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

version control with private branches?

While I know you can use a second repository for backup, or create a branch named 'privateBranchOfXcompletelyBrokenBackupOnly', I'm interested to hear about a version control system that supports remote private branches natively.

edit: forgot to tell that it should be remote private. Seems only mirror-pushing to a private repo mimicks this.

like image 463
koen Avatar asked Dec 19 '25 00:12

koen


2 Answers

One of the great things about the new generation of DVCS (such as Git, which I use) is that an individual developer has great control over how they choose to work. Using Git, I can create my own private branches that mean specific things to me but not necessarily anybody else, and work with them locally without anybody else even needing to be aware of their existence. I can move changes between those branches, sort and organise commits, and only push my changes upstream when I'm ready to share them.

With a centralised system such as CVS or even Subversion, creating a branch is a world-visible, heavyweight operation that actually changes the shared repository. You have to be diligent in naming your branches (so individual developers don't collide) and manually clean things up when you're done.

Having said the above, Git also supports public branches easily, where I can create a branch, do some work, and push it upstream so that others can collaborate on that branch with me. Or, I can create a branch and a coworker can pull it from me directly without having to share it with everybody.

The site Why Git is Better Than X has more information about this feature. In fact, the first item is titled "Cheap Local Branching".

like image 184
Greg Hewgill Avatar answered Dec 21 '25 15:12

Greg Hewgill


Git does a great job of handling private branches natively. Each developer gets their own branch that they can do with as the please, then when they are ready to share their changes with the other developers, they just merge their changes back into the main branch.

It's certainly not perfect for everyone or for every project, but in many cases this approach has some great benefits.

like image 35
Brandon Wood Avatar answered Dec 21 '25 13:12

Brandon Wood



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!