Reputation: 402
At my company, we have a central CVS server. We have different branches for each product version that is still actively supported. Locally, I use Git, basically following the approach from http://undefinedvalue.com/2010/07/02/workflow-remote-cvs-local-git (git cvs took a very long time and then stopped with an error :-/ ).
I am using a separate Git repository for each CVS branch (where each CVS branch is checked out in a different directory). So for example I have directories ~/dev/our_product/v2, ~/dev/our_product/v3, ~/dev/our_product/v4, and ~/dev/our_product/main, each with .git directly in the directory. The master branch follows CVS (I update it manually by periodically doing cvs update followed by git commit).
I am now thinking about combining all these Git repos into one. If I understand How to combine two branches from two different repositories in a single repository? correctly, I can create a new repo and make it track all the existing repos. That also imports all branches from the existing repos, right? And can I throw the existing repos away afterwards? Or should I use a different method if I want to do that?
I also wonder if that will facilitate my workflow.
Use case 1: I start developing a feature for the CVS main branch, by creating a feature branch called some-feature. Then I learn that it has to go into v3. Can I just rebase the feature branch to v3?
Use case 2: When I make a change in v2 (on a feature branch some-other-feature), I have to merge it into v3, v4, and main. Can I do that by simply typing "git merge some-other-feature" in the respective CVS-tracking branches?
Best regards,
Jens
Upvotes: 1
Views: 203
Reputation: 1324977
I can create a new repo and make it track all the existing repos. That also imports all branches from the existing repos, right?
You will indeed by able to fetch all the branches from the remote repos in your unique repo, but you should then make a local branch starting from those remote branches.
Once it is done, you can delete those remote references, and no longer use your git-cvs repos.
And can I throw the existing repos away afterwards?
If you don't need them to publish back to CVS, yes.I start developing a feature for the CVS main branch, by creating a feature branch called some-feature. Then I learn that it has to go into v3. Can I just rebase the feature branch to v3?
Yes, a rebase before a merge, as described in "git rebase vs git merge".Can I do that by simply typing "
git merge some-other-feature
" in the respective CVS-tracking branches?
Yes, that is the idea in order to propagate it to those branches.
Upvotes: 1