gitgit-submodulesmultiple-repositoriesgit-branch-sculptingcommon-files

Git: Multiple repositories in same folder with common files and code


I am looking at moving a large codebase to Git. There are many groups working on the codebase and multiple release builds are in [staggered] production. Some people will be working on ReleaseBuild A and ReleaseBuild B at the same time and will need the ability to switch between the build repositories while using the same folder. Many of the files and folders will be different and many the same in each release build repository. Each repository should follow its own branching model like the one seen here: http://nvie.com/posts/a-successful-git-branching-model/ .

The reason users need to use the same folder to build files is due to the way the build scripts are setup and "security". Changing the paths would not be ideal. I have considered making separate subtrees in a single module, but that sounds messy. Submodules also sound interesting, but I am unsure if they would work if I want to use one over the other and both submodules share the same folder.

TLDR: Does anyone know of a good way of managing multiple baselines that have concurrent work being done on them using the same local folder for each?


Solution

  • From this comment I can guess you are taking care of some enterpriseā„¢ application... ugh. Just throw a bunch of branches at it and call them appropriately, like ReleaseA, ReleaseB (or ReleaseX_environment if you need to separate environments) and so on. Force your colleagues to keep the naming convention while working on features, for instance if you're using JIRA let branches be named ReleaseX_TICKET-000.

    If there is no main release version, you can delete the master branch.

    GIT tree for your project might look like this

    If they don't know GIT, teaching them how to switch between branches will be way easier than teaching how to switch between sub modules and sub trees, not to mention merging that mess together.

    And if some day your company decides that there's a need to force code reviews, the person responsible for moving it all to gerrit will thank you.