Annotation of wikisrc/tutorials/how_to_setup_a_cvs_server.mdwn, revision 1.4

1.2       schmonz     1: **Contents**
                      2: 
                      3: [[!toc]]
                      4: 
                      5: #  What is CVS 
                      6: 
                      7: CVS is an abbreviation for Concurrent Versions System. 
                      8: 
                      9: #  Requirements 
                     10: 
                     11: Nothing. CVS comes with the NetBSD base installation. 
                     12: 
                     13: #  Setting up the repository 
                     14: 
                     15: First decide where you want to store all cvs repositories. Let's take /usr/cvsrepositories 
                     16:     
                     17:     # mkdir /usr/cvsrepositories
                     18:     
                     19: 
                     20: Now you can create directories for different projects. 
                     21:     
                     22:     # cd /usr/cvsrepositories
                     23:     # mkdir mycompany
                     24:     # mkdir myprivatestuff
                     25:     
                     26: 
                     27: This projects must have chmod 770 to separate them from each other. 
                     28:     
                     29:     # chmod 770 mycompany
                     30:     # chmod 770 myprivatestuff
                     31:     
                     32: 
                     33: #  Creating user groups 
                     34: 
                     35: You should create a group for projects, where people are working together. 
                     36:     
                     37:     # group add mycompanyname
                     38:     
                     39: 
                     40: You should now assign this group to the project directory they belong. 
                     41:     
                     42:     # cd /usr/cvsrepositories
                     43:     # chgrp mycompanyname mycompany/
                     44:     
                     45: 
                     46: #  cvs init 
                     47: 
                     48: 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 /. 
                     49:     
                     50:     # cd /
                     51:     # ln -s /usr/cvsrepositories/mycompany mycompany
                     52:     
                     53: 
                     54: Now create the cvs repository using 
                     55:     
                     56:     # cvs -d /mycompany/ init
                     57:     
                     58: 
                     59: #  Creating users 
                     60: 
                     61: Now create users that are allowed to check out from your repository. Keep company workers in the group you have created before. 
                     62:     
                     63:     # useradd -G mycompanyname -m john
                     64:     
                     65: 
                     66: And set a password for the user john 
                     67:     
                     68:     # passwd john
                     69:     
                     70: 
                     71: It's your decision if you want to grant the users shell access or not. 
                     72: 
                     73: #  Setting environment variables 
                     74: 
                     75: Please set the environment variables CVSROOT and CVS_RSH. Bash or ksh users please use export. 
                     76:     
                     77:     # export CVSROOT=username@yourserver.com:/mycompany
                     78:     # export CVS_RSH=ssh
                     79:     
                     80: 
                     81: csh users set it like this: 
                     82:     
                     83:     # setenv CVSROOT username@yourserver.com:/mycompany
                     84:     # setenv CVS_RSH ssh
                     85:     
                     86: 
                     87: As you can see we use ssh as the transport protocol. This is recommended. Keep your transfers encrypted. 
                     88: 
                     89: #  Initial check in 
                     90: 
                     91: 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. 
                     92: 
                     93: Now please change into the directory you wish to import initially. 
                     94:     
                     95:     # cd myproject
                     96:     
                     97: 
                     98: and import it to your cvs server. 
                     99:     
                    100:     # cvs import -m "myproject initial import" myproject myproject initial
                    101:     
                    102: 
                    103: this should produce an output like this: 
                    104:     
                    105:     
                    106:     N myproject/test.c
                    107:     N myproject/test.h
                    108:     N myproject/mi/mi.h
                    109:     N myproject/md/md.h
                    110:     
                    111:     No conflicts created by this import
                    112:     
                    113: 
                    114: #  checkout 
                    115: 
                    116: To checkout the work, set your environment variables and enter 
                    117:     
                    118:     # cvs co -PA myproject
                    119:     
                    120: 
                    121: This will checkout myproject. 
                    122: 
                    123: #  ssh config 
                    124: 
                    125: Please configure your ssh client to fit your need in .ssh/config, like using a different ssh port than 22. 
                    126: 
1.4     ! kim       127: That's it. For more information about [[!template id=man name="cvs" section="1"]] and using it please read the manpage. 
1.2       schmonz   128: 
                    129: #  See also 
                    130: 
1.4     ! kim       131:   * [[!template id=man name="cvs" section="1"]]
        !           132:   * [[!template id=man name="groupadd" section="8"]]
        !           133:   * [[!template id=man name="useradd" section="8"]]
1.2       schmonz   134: 

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