Importing CVS Files to Git

Recently I decided to import some of my files stored on CVS repositories into Git. The idea is to make the files easier to maintain and update. Also, this way I don’t need to remember different methods to update files. Finally, it is nice to be able to use git tools such as git-gui.

The process is simple. You just need to use the git cvsimport command. This is my command line:

git cvsimport -a -v -d <location of cvsroot> -C newDir <module>

The meaning of this is as follows: the -a parameter is used to import the whole history (if you have a long history, maybe this will be slow). The -v option shows what is going on (verbose). The -d has the same meaning as on the cvs command, i.e., to show the where the root directory is. The -C option determines where the result will be stored. And finally you need to type the name of the module.

I really wanted to import all modules at the same time, but it seems that cvsimport doesn’t know how to do this. I tried to use “.” as a module name. That works with cvs to checkout everything, but cvsimport doesn’t like it. Anyway, I now can import my old files and use only git.

Similar Posts:

About the Author

Carlos Oliveira holds a PhD in Systems Engineering and Optimization from University of Florida. He works as a software engineer, with more than 10 years of experience in developing high performance, commercial and scientific applications in C++, Java, and Objective-C. His most Recent Book is Practical C++ Financial Programming.

2 Responses to “Importing CVS Files to Git”

  1. Hello from Russia!
    Can I quote a post in your blog with the link to you?

    By Polprav on Oct 22, 2009

  2. Yes, no problem.

    By coliveira on Oct 23, 2009

Post a Comment