Diff for /wikisrc/tutorials/how_to_setup_a_cvs_server.mdwn between versions 1.1 and 1.2

version 1.1, 2011/11/20 20:55:21 version 1.2, 2012/02/05 07:14:36
Line 1 Line 1
 **Contents**  **Contents**
   
 [[!toc]]  [[!toc]]
   
 #  What is CVS  #  What is CVS 
   
 CVS is an abbreviation for Concurrent Versions System.  CVS is an abbreviation for Concurrent Versions System. 
   
 #  Requirements  #  Requirements 
   
 Nothing. CVS comes with the NetBSD base installation.  Nothing. CVS comes with the NetBSD base installation. 
   
 #  Setting up the repository  #  Setting up the repository 
   
 First decide where you want to store all cvs repositories. Let's take /usr/cvsrepositories  First decide where you want to store all cvs repositories. Let's take /usr/cvsrepositories 
          
     # mkdir /usr/cvsrepositories      # mkdir /usr/cvsrepositories
          
   
 Now you can create directories for different projects.  Now you can create directories for different projects. 
          
     # cd /usr/cvsrepositories      # cd /usr/cvsrepositories
     # mkdir mycompany      # mkdir mycompany
     # mkdir myprivatestuff      # mkdir myprivatestuff
          
   
 This projects must have chmod 770 to separate them from each other.  This projects must have chmod 770 to separate them from each other. 
          
     # chmod 770 mycompany      # chmod 770 mycompany
     # chmod 770 myprivatestuff      # chmod 770 myprivatestuff
          
   
 #  Creating user groups  #  Creating user groups 
   
 You should create a group for projects, where people are working together.  You should create a group for projects, where people are working together. 
          
     # group add mycompanyname      # group add mycompanyname
          
   
 You should now assign this group to the project directory they belong.  You should now assign this group to the project directory they belong. 
          
     # cd /usr/cvsrepositories      # cd /usr/cvsrepositories
     # chgrp mycompanyname mycompany/      # chgrp mycompanyname mycompany/
          
   
 #  cvs init  #  cvs init 
   
 Before you can either checkout or import anything, you have to init your projects root directory. To keep the path short for the CVSROOT environment variable, I recommend using symlinks to the repository from the root /.  Before you can either checkout or import anything, you have to init your projects root directory. To keep the path short for the CVSROOT environment variable, I recommend using symlinks to the repository from the root /. 
          
     # cd /      # cd /
     # ln -s /usr/cvsrepositories/mycompany mycompany      # ln -s /usr/cvsrepositories/mycompany mycompany
          
   
 Now create the cvs repository using  Now create the cvs repository using 
          
     # cvs -d /mycompany/ init      # cvs -d /mycompany/ init
          
   
 #  Creating users  #  Creating users 
   
 Now create users that are allowed to check out from your repository. Keep company workers in the group you have created before.  Now create users that are allowed to check out from your repository. Keep company workers in the group you have created before. 
          
     # useradd -G mycompanyname -m john      # useradd -G mycompanyname -m john
          
   
 And set a password for the user john  And set a password for the user john 
          
     # passwd john      # passwd john
          
   
 It's your decision if you want to grant the users shell access or not.  It's your decision if you want to grant the users shell access or not. 
   
 #  Setting environment variables  #  Setting environment variables 
   
 Please set the environment variables CVSROOT and CVS_RSH. Bash or ksh users please use export.  Please set the environment variables CVSROOT and CVS_RSH. Bash or ksh users please use export. 
          
     # export CVSROOT=username@yourserver.com:/mycompany      # export CVSROOT=username@yourserver.com:/mycompany
     # export CVS_RSH=ssh      # export CVS_RSH=ssh
          
   
 csh users set it like this:  csh users set it like this: 
          
     # setenv CVSROOT username@yourserver.com:/mycompany      # setenv CVSROOT username@yourserver.com:/mycompany
     # setenv CVS_RSH ssh      # setenv CVS_RSH ssh
          
   
 As you can see we use ssh as the transport protocol. This is recommended. Keep your transfers encrypted.  As you can see we use ssh as the transport protocol. This is recommended. Keep your transfers encrypted. 
   
 #  Initial check in  #  Initial check in 
   
 You should now proceed with the the initial check in of your (code)work. You can do this from another server aswell. Don't forget to set the environment variables there too.  You should now proceed with the the initial check in of your (code)work. You can do this from another server aswell. Don't forget to set the environment variables there too. 
   
 Now please change into the directory you wish to import initially.  Now please change into the directory you wish to import initially. 
          
     # cd myproject      # cd myproject
          
   
 and import it to your cvs server.  and import it to your cvs server. 
          
     # cvs import -m "myproject initial import" myproject myproject initial      # cvs import -m "myproject initial import" myproject myproject initial
          
   
 this should produce an output like this:  this should produce an output like this: 
          
          
     N myproject/test.c      N myproject/test.c
     N myproject/test.h      N myproject/test.h
     N myproject/mi/mi.h      N myproject/mi/mi.h
     N myproject/md/md.h      N myproject/md/md.h
          
     No conflicts created by this import      No conflicts created by this import
          
   
 #  checkout  #  checkout 
   
 To checkout the work, set your environment variables and enter  To checkout the work, set your environment variables and enter 
          
     # cvs co -PA myproject      # cvs co -PA myproject
          
   
 This will checkout myproject.  This will checkout myproject. 
   
 #  ssh config  #  ssh config 
   
 Please configure your ssh client to fit your need in .ssh/config, like using a different ssh port than 22.  Please configure your ssh client to fit your need in .ssh/config, like using a different ssh port than 22. 
   
 That's it. For more information about [cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-current) and using it please read the manpage.  That's it. For more information about [cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-current) and using it please read the manpage. 
   
 #  See also  #  See also 
   
   * [cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-current)    * [cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-current)
   * [groupadd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?groupadd+8+NetBSD-current)    * [groupadd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?groupadd+8+NetBSD-current)
   * [useradd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?useradd+8+NetBSD-current)    * [useradd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?useradd+8+NetBSD-current)
   

Removed from v.1.1  
changed lines
  Added in v.1.2


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb