CVS and RCS to Git: version control and migration today

Updated November 2026

CVS and RCS still run on a few old servers, but new work belongs in Git. If you know CVS, you already know most of the ideas: check out, commit, diff, tag. This page maps the old commands to Git, then shows how to move a CVS, RCS or Subversion history into Git without losing it.

The classic CVS-RCS HOWTO has been withdrawn from tldp.org for review. As of November 2026, Git 2.56 is the current release (Debian 13 ships 2.47). Everything below works with any Git from the last few years.

What changes when you move to Git

The commands side by side

CVS and RCS commands and their Git equivalents
TaskCVS / RCSGit
Get a working copycvs checkout projgit clone URL
Bring in others' changescvs update -dgit pull
Add a filecvs add filegit add file
Remove a filecvs remove filegit rm file
Rename a file(remove + add, history lost)git mv old new
Show changescvs diff -u / rcsdiffgit diff
Commitcvs commit / ci -ugit commit -a, then git push
Historycvs log / rloggit log
Who changed each linecvs annotategit blame file
Statuscvs -n updategit status
Tag a releasecvs tag REL_1_4git tag -a v1.4.0, then git push origin v1.4.0
Make a branchcvs tag -bgit switch -c name
Undo local editsrm file; cvs update filegit restore file

A first Git session

Install Git (sudo apt install git on Debian and Ubuntu, sudo dnf install git on Fedora and RHEL, sudo pacman -S git on Arch). Tell Git who you are, once per user:

git config --global user.name "Ada Lovelace"
git config --global user.email "ada@example.org"
git config --global init.defaultBranch main

Put an existing directory under version control, then work on a branch:

cd ~/src/report-tool
git init
git add .
git commit -m "Import report-tool"
git switch -c fix-dates      # new branch, and switch to it
$EDITOR report.c
git diff                     # review
git commit -am "Parse ISO dates"
git switch main
git merge fix-dates
git log --oneline --graph

Add a .gitignore file listing build output (*.o, build/) the same way you used .cvsignore.

What about $Id$ and $Log$?

Git does not expand RCS keywords by default. If you need $Id$, set the ident attribute in .gitattributes (for example *.c ident). Git then replaces $Id$ with the file's blob ID on checkout. That is a content hash, not a revision number. There is no $Log$, $Revision$ or $Author$. Most projects simply delete these lines after migrating, because git log and git blame give the same information.

Convert a CVS repository

All CVS converters read the repository's ,v files directly. A working checkout is not enough. If the server is remote, copy the whole repository first, for example with rsync -a cvs.example.org:/var/cvs/ ./cvsroot/. Freeze the CVS server before the final run, because these tools do not follow a live repository.

Option 1: cvs-fast-export (packaged)

cvs-fast-export is packaged in Debian 13 and Ubuntu (sudo apt install cvs-fast-export). It also reads plain RCS collections, so it covers both cases. It writes a Git fast-import stream:

cd cvsroot/myproject
find . | cvs-fast-export -A ~/authors.map > ~/myproject.fi
cd ~
git init myproject
cd myproject
git fast-import < ~/myproject.fi
git branch -a                 # see which branches were created
git switch master             # or whichever branch holds the trunk

The author map turns CVS user names into real identities, one per line: ferd = Ferd J. Foonly <foonly@example.org>. You can also add an optional time zone after the address (America/Chicago). Non-ASCII user IDs are not supported.

Option 2: cvs2git

cvs2git, part of cvs2svn, is very good at making sense of tangled histories. However, the project says it is in maintenance mode, and it needs Python 2, which current distributions no longer ship. Its source tree includes a Dockerfile that builds a working environment, and its README calls that the easiest way to run it today. The conversion itself looks like this:

cvs2git --blobfile=cvs2git-tmp/git-blob.dat \
        --dumpfile=cvs2git-tmp/git-dump.dat \
        --username=cvs2git /path/to/cvsroot/myproject
git init --bare myproject.git
cd myproject.git
cat ../cvs2git-tmp/git-blob.dat ../cvs2git-tmp/git-dump.dat | git fast-import
git branch -D TAG.FIXUP
git gc --prune=now

The result is a bare repository, ready for a server. Clone it to work on it.

Why not git cvsimport?

Git still includes git cvsimport, but its own manual warns against it. It needs the deprecated cvsps version 2, and it can import history incorrectly. Its known problems include misordered commits, empty branches dropped, and multiple tags on one revision not imported. For a one-time conversion, the manual itself points to cvs2git or cvs-fast-export.

Convert a Subversion repository

git svn (package git-svn on Debian and Ubuntu) can clone a Subversion repository with full history. First list every Subversion committer in an authors file. git svn stops if it finds a name that is not in the file:

# authors.txt
jsmith = Jane Smith <jane@example.org>
build = Build Robot <>
git svn clone https://svn.example.org/repos/proj --stdlayout \
    --prefix=svn/ --authors-file=authors.txt proj
cd proj
git svn create-ignore        # turn svn:ignore into staged .gitignore files
git commit -m "Convert svn:ignore to .gitignore"

--stdlayout means the usual trunk, branches and tags directories. Subversion tags are copies that can be changed later, so git svn imports them as branches named svn/tags/…. After the final sync, turn each one into a real tag with git tag, then delete the branch. For large or messy histories, look at reposurgeon (also packaged in Debian 13). It is built to clean up conversions.

Check the conversion

Where to host it

The simplest server is a bare repository reached over SSH, with no extra software:

ssh git.example.org 'git init --bare /srv/git/myproject.git'
git remote add origin git.example.org:/srv/git/myproject.git
git push -u origin main
git push origin --tags

For a web interface, issues and code review, you can self-host Forgejo, Gitea or GitLab. Or you can use a hosted service such as Codeberg, GitLab.com or GitHub. Because every clone is complete, moving between hosts later is just another push.

Mistakes to avoid

Next: tag, sign and ship releases, or use Git from your editor with Emacs.

Sources