Search code examples
gitversion-controlbranchperforcedvcs

Source control systems allowing partial branching


This was originally a question targeting git/bitbucket, but after finding our requirements cannot be supported, I'm searching for alternatives.

We have a main codebase that has some 'confidential' libraries. We need a way to create branch or fork for investigation purposes (for off-site workers) that will not contain chosen confidential files, but for all other files there still will be ability to push, pull, see entire history.

I've been able to achieve same in perforce/SourceDepot VCSs, however I want to see what are our other options.

Big plus would be an ability to migrate with history from bitbucket. Another big plus would be ability of some (even custom) http hosting for browsing codes/history that would have some ability to integrate with JIRA (as bitbucket/git does).

Here is an example of what I want to achieve:

Repo1(main):
 |-publicFolder
    |-file1
    |-file2
 |-privateFolder
    |-fileA
    |-fileB

Repo2(investigation):
 |-publicFolder
    |-file1
    |-file2

EDIT:

It appears that the scenario is achievable in mercurial by combining two things - convert extension plus the subrepos feature suggested by Lazy Badger

the convert part would need following filemap.txt:

include publicFolder

and following convert command:

hg convert --filemap filemap.txt path/to/local/Repo1 path/to/local/Repo2

next step is deleting the publicFolder from Repo1 and finally creating thin subrepo shell above both of those repos (to be able to treat them as a single repository if needed).


Solution

    • Externals in SVN
    • Submodules in Git
    • Subrepos in Mercurial

    are more or less notable and widely known iterations to the specified task (separation and aggregation) (you have to write, why it's wrong or there they are failed)