Roland's homepage

My random knot in the Web

Convert RCS history to git

Before the rise of git, I used rcs as my version control system. Because I want to standardize on git, I am slowly converting old repositories.

In this article I’ll be converting my old perl scripts in ~/src/perl.

Create a fast-import stream

From the existing repo, we create a fast-import stream using cvs-fast-export.

cd ~/src/perl
find . | cvs-fast-export -A ~/authormap > ../

Create new repo

Next, we create a new directory and initialize it as a git repo.

cd ~/src
mkdir new-perl
cd new-perl
git init .

Performing the import

Now we import the RCS data.

git fast-import <../
git checkout

Commit changes that were not committed to RCS

There might be changes in the directory that were not recorded in RCS. In this case we will import them all in one go, just to capture the state of these files.

cp ../perl/*.pl .
git add .
git commit -m "Record uncommitted changes."

Update directories

For a time, we want to keep the old data around just in case we missed something. However, the new git repo is now the canonical source.

cd ~/src
mv perl old-perl
mv new-perl perl

←  Removing big files from git history Transplanting noscript settings and bookmarks to another machine  →