views:

375

answers:

4

I've never forked a project before so I'm a little stumped as to how to proceed. I have a project that I use on my own that I release as a BSD licensed project (Project A). At work I want to use that code but with modifications specific to our company (Project B) but I want to be able to still update with features that come from the base code I release.

What's the best way to handle having two forks of a project and incorporating changes from Project A into Project B without overwriting the mods I make to Project B?

+1  A: 

In Subversion, 'forking' is 'branching', and 'Incorporating changes' is 'merging'.

I don't think you can get away without reading the relevant sections of The Subversion book fairly carefully. It's very clearly written and easy to understand once you commit the time to it.

slim
Yeah, that I know :) My problem is having two separate repos instead of branching/merging all within one.
dragonmantank
You cannot branch, but you can export the current version of the project and add it to the other repo (so you have a brand new copy). Once there, you can still merge between them.
gbjbaanb
A: 

Unless Work is willing release those modifications back to the original project, I would start a brand new SVN project there (Project B). Then, as you progress to your next release of the BSD licensed project (Project A), you can make change sets from the last release, and then apply them back to Project B.

It may seem like multiple personality disorder, but you have to act as two different entities depending where you are (Word or Home).

IFF on the other hand Work is willing to release those modifications back to the original project, then your better option is to make a branch and merge your changes to Project A into Projet B (periodically).

CodeSlave
A: 

It is being split into two entities with my main repo on Google Code and then the company version in our own internal repo. My question is keeping everything sane as it comes time to upgrade from release to release but keeping custom modifications.

dragonmantank
+3  A: 

See the section in previously mentioned The Subversion Book discussing "vendor branches". This dicusses how to deal with an external subproject so you can both merge in changes when the external project is updated and merge in your own local modifications.

This approach should work well if you treat the public version of your project (hosted on Google Code) as the extenal dependency in your companie's code.

Stephen C. Steel