Earlier this year we had a talk about GIT (a distributed version control system), the truth is that I had used a few times for my personal projects but at work I was (and still) using CVS. As this year I had the opportunity to use and learn more about how GIT works, I proposed in my work to migrate our repository and modernize us a bit.
Obviously we will need to access to the whole history and tags from GIT. I’ve been researching a little about the migration process so I made a little ‘manual’ I hope we can implement in the coming weeks. Of course there is a lot of documentation and manuals on how to migrate from CVS to GIT, this is just a summary of the steps we will have follow in our case.
I obtained much of the information from “CVS to git Transition Guide” but this guide included to freeze the CVS archive and we will not need to do so.
We will use git command “git cvsimport” which will allow us to fetch and update the GIT repository from CVS repository. We want to create a central master repository (as we have in CVS) with the master branch.
git cvsimport -v -k -i -d /path/to/CVSROOT -C project project
Now we will create a new repository without a working copy (project.git) cloning the repository that we have created:
git clone --bare project
rm -rf project
On the other hand, the committers have to create a clone to start working with him:
git clone :project.git
And they will have to set some things:
git config --global user.name "Your Name"
git config --global user.email "firstname.lastname@example.org"
To make it more comfortable to do pulls is convenient to add what is called ‘remote’:
git remote add origin :project.git
git push origin master
Someday I will tell you how was the experience because we have some reluctance on the team … hopefully we will convince them!