Importing from a CVS repository can be done using git-cvsimport either by direct access to the remote CVS server or from a snapshot tarball. The procedure includes the following steps:
- Import a CVS repository to a git repository (ususally on a local machine)
- Create a bare clone of the latter to be used as a shared read/write repository (again locally)
- Set a new repository on the server through gitosis (see above "Starting a new project repository)
- Push the cloned one in 2. to the newly created one in 3.
All steps above should be done on a local machine.
1.CVS repository import
cvsimport 설치 필요
Direct import from a server
user@local# cvs -z3 -d :pserver:anoncvs@cvs.curvc.com:/home/gmx/cvs login user@local# git cvsimport -A ./authors.txt -v -a -i -k -d :pserver:anoncvs@cvs.curvc.com:/home/gmx/cvs -C gromacs-cvs.git cmx
This way is very slow, and it is much faster to use a tarball of a CVS snapshot.
- authors.txt: CVS 사용자를 Git 사용자로 맵핑
형식 예)
username1_in_cvs = Git User1 <gituser1@curvc.com>
username2_in_cvs = Git User2 <gituser2@curvc.com>
(Alternative) Import from a CVS snapshot tarball
rossen@cvs.curvc.com# cd /home/gmx rossen@cvs.curvc.com# tar cvfz /home/rossen/gromacs-cvs-20090218.tar.gz cvs rossen@local# pwd /home/rossen/temp rossen@local# scp cvs.curvc.com:gromacs-cvs-20090218.tar.gz . rossen@local# tar xvfz gromacs-cvs-20090218.tar.gz rossen@local# git-cvsimport -a -i -k -d /home/rossen/temp/cvs -C gromacs-cvs.git gmx
2. Create a bare clone of the imported GIT
rossen@local# mkdir gromacs rossen@local# cd gromacs rossen@local# git --bare init --shared rossen@local# git --bare fetch ../gromacs-cvs.git master:master rossen@local# git remote add gromacs git@git.curvc.com:gromacs.git
3. Set a new repository on the server
Git 서버에서 gromacs repository 생성
4. Push the clone to the server
rossen@local# git push gromacs --mirror