Skip to content

cvsimport Git Command Guide

The git cvsimport command imports a CVS repository into Git, creating a Git repository with history that mirrors the CVS repository. It’s designed for migrating projects from CVS to Git.

Terminal window
git cvsimport [<options>] <CVS_module>
OptionDescription
-v, —verboseVerbose output
-d Specify CVSROOT
-C Create/import into existing Git repository
-r Name for tracked remote
-o Branch name for the Git branch (default: origin)
-iDo not perform a checkout after importing
-kKill keywords when importing
-b Specify branch to import (default: current CVS branch)
-mAttempt to detect merges
-M Use manual mapping
-S Skip paths matching regex
-aImport all commits, including empty ones
-p Pass additional options to cvsps
-z Set changeset fuzzy-ness (seconds, default 300)
-s Substitute characters in branch names
-uConvert underscores in branch names to dots
-L Limit number of commits imported
—no-minimize-urlDon’t attempt to shorten URLs
—helpDisplay help
ParameterDescription
<CVS_module>CVS module to import
Terminal window
git cvsimport -d :pserver:user@cvs.example.com:/cvs mymodule

Imports the ‘mymodule’ from CVS to current directory as Git repository.

Terminal window
git cvsimport -C ../git-repo -d $CVSROOT mymodule

Imports into existing Git repository with custom directory.

Terminal window
git cvsimport -b main-branch -v mymodule

Imports only the ‘main-branch’ CVS branch with verbose output.

Terminal window
git cvsimport -S "^doc/" mymodule

Imports all paths except those starting with ‘doc/’.

Terminal window
git cvsimport -L 100 mymodule

Imports only the first 100 commits.

Terminal window
git cvsimport -i mymodule

Imports commits but doesn’t perform a checkout after import.

Terminal window
git cvsimport -r upstream mymodule

Sets remote name to ‘upstream’ instead of default ‘origin’.

How do I import a CVS repository into Git?

Section titled “How do I import a CVS repository into Git?”

To import a CVS repository into Git, use:

Terminal window
git cvsimport -d <CVSROOT> <CVS_module>

How can I import into an existing Git repository?

Section titled “How can I import into an existing Git repository?”

To import into an existing Git repository, run:

Terminal window
git cvsimport -C <directory> -d <CVSROOT> <CVS_module>

To import only a specific branch, execute:

Terminal window
git cvsimport -b <branch-name> <CVS_module>

How can I skip certain paths during import?

Section titled “How can I skip certain paths during import?”

To skip certain paths during import, use:

Terminal window
git cvsimport -S <regex> <CVS_module>

How do I limit the number of commits imported?

Section titled “How do I limit the number of commits imported?”

To limit the number of commits imported, run:

Terminal window
git cvsimport -L <number> <CVS_module>
  1. Migrating legacy projects from CVS to Git
  2. Converting CVS repositories for modern development workflows
  3. Importing historical codebases into Git ecosystems
  4. Supporting migration strategies in enterprise environments
  5. Creating Git mirrors of existing CVS repositories
  6. Enabling modern CI/CD pipelines on CVS-based projects