- Install git-cvs package which includes the migration tools:sudo apt-get install git-cvs
 
- Set the cvs repository to read-only:sudo chmod -R ugo-w /path/to/CVSROOT
 
- Make the root directory for git and give permissions to the dev-users group:sudo mkdir /path/to/git
sudo chgrp dev-users /path/to/git
sudo chmod 6775 /path/to/git
sudo chmod +t /path/to/git
 
- Migrate the cvs modules into git (in the example below, proj1 is the name of the cvs module and it is also used as the name of the git directory):cd /path/to/git
git cvsimport -k -i -d /path/to/CVSROOT -C proj1 proj1
 
- Rename the git project directory:sudo mv /path/to/git/proj1/.git /path/to/git/proj1.git
sudo rmdir /path/to/git/proj1
 
- Fix permissions of the git project directory:sudo chgrp -R dev-users /path/to/git/proj1.git
sudo chmod -R ug+w /path/to/git/proj1.git
sudo chmod +s /path/to/git/proj1.git
cd /path/to/git/proj1.git
# the hooks/ and info/ dirs are special since the control repository access
sudo chgrp -R git-admin hooks info config description
sudo find -type d -exec chmod +s {} \;
 
- Configure the git project to be bare git repository:cd /path/to/git/proj1.git
git config --bool core.bare true
git config --bool receive.denyNonFastforwards true
git config core.sharedRepository group
 The config file should be look like below:[core]
    repositoryformatversion = 0
    filemode = true
    bare = true
    sharedRepository = group
    logallrefupdates = true
[receive]
    denyNonFastforwards = true
 
No comments:
Post a Comment