Progress:
TIER 2 · MODULE 32· Intermediate

git cvsimport

Migration tool for the historical.

🎯 What & why

git cvsimport pulls a CVS repository's history into a new Git repo, commit by commit. It is the canonical first step when escaping CVS.

🧠 Mental model

Think of it as a tape player: it reads CVS RCS files (often via cvsps to group them into commits) and replays them as Git commits with the original metadata.

🛠️ Synopsis

    git cvsimport [-v] [-d <CVSROOT>] [-C <git-repo>] [-r <remote>]
                  [-A <authors-file>] [-k] [-s <subst>] [-i]
                  [-p <opts-for-cvsps>] [<CVS_module>]

Requires cvsps installed and reachable. Run from an empty target
directory or pass -C to name one.

🎚️ Switches & options

FlagWhat it does
-vVerbose; show every patchset as it is imported
-d <CVSROOT>CVSROOT spec, e.g. :pserver:user@127.0.0.1:/srv/cvs
-A <authors-file>Map CVS user IDs to 'Name <email>' lines for proper Git authorship
-iImport only; do not check out a working tree afterward
-kStrip CVS keyword expansions ($Id$ etc.) from imported content
-r <remote>Place imported branches under refs/remotes/<remote>/ instead of local heads
-s <subst>Substitute character in branch names (CVS allows chars Git does not)

💡 Use cases

🧪 Examples

Verbose import from a local CVSROOT
git cvsimport -v -d /srv/cvs -C myproj.git -i myproj
Import from a pserver with author mapping
git cvsimport -v -d :pserver:anon@127.0.0.1:/srv/cvs -A authors.txt myproj
Mirror under a remote namespace, stripping keywords
git cvsimport -v -k -r cvs -d :pserver:anon@127.0.0.1:/srv/cvs myproj
Replace illegal branch chars
git cvsimport -v -s _ -d :pserver:anon@127.0.0.1:/srv/cvs myproj

🎓 Recommendations

🪤 Common pitfalls

🔗 Related modules

📝 Quiz

Hit each option, then Check answers. Score is recorded; Next is always open.