Ori Shavit
Ori Shavit

Reputation: 255

Mirroring CVS repository to git repository

I have searched around, and I haven't understood what is the best way to do this: I want to clone an existing CVS repository (specifically, OpenSSH portable) , or a revision of it (eg v6.0p1) to a git repo, for applying personal patches. I would also like to merge changes whenever another stable OpenSSH is released. It doesn't have to be in real-time or anything special, just to be able to merge my patches to new versions.

I have previous git (and SVN experience), but no CVS experience.

Upvotes: 1

Views: 942

Answers (1)

Andrew Aylett
Andrew Aylett

Reputation: 40760

You have two options: maintain a vendor branch or use git cvsimport. Which you use depends on how much history you want and how patient you are.

If you want full history and are patient, you can import the whole CVS repo into git using git cvsimport. If you're fortunate, you may find that someone else has already done this and is keeping the result up-to-date -- if you trust them, using their repo is the best options.

If you don't need full history or are impatient, you can maintain a vendor branch: this is what we used to do before we had a DVCS :). Grab a copy of the current release, put it in a branch called 'vendor' and base your work on it. When the next release is made, switch back to the vendor branch, update it to match the new release and merge/rebase as appropriate.

Note that while vendor branches are required less often when using a DVCS, they're actually much easier in git than they were with Subversion, as git doesn't require you to identify renames and (as with svn now) doesn't leave meta-data all over your working copy that gets blitzed when you unpack the latest release.

Upvotes: 2

Related Questions