15. Example: Creating a new project from scratch
In this example a new project is started from scratch.
The project administrator must first create the CVS repository. In this example all project files will be stored in /home/projects/myproj and only the project members can access that directory. The project members must be in the grpname group. Please note how the "set-group-id" bit is set with the chmod command.
[Done on the CVS server]
# mkdir /home/projects/myproj
# mkdir /home/projects/myproj/cvsroot
# chgrp -R grpname /home/projects/myproj # change group
# chmod 2770 /home/projects/myproj # make group writable
# cvs -d /home/projects/myproj/cvsroot init # create the repository
or
[Done remotely]
# ssh mylogin@host.name.com mkdir -p /home/projects/myproj/cvsroot
# ssh mylogin@host.name.com chgrp -R grpname /home/projects/myproj
# ssh mylogin@host.name.com chmod 2770 /home/projects/myproj
# cvs -d mylogin@host.name.com:/home/projects/myproj/cvsroot init
Next we need an empty directory which will be imported as a new "project". The project is called src in the following example. Please note that foo and bar are required but not really used as the imported directory is empty.
# mkdir /tmp/src
# cd /tmp/src
# cvs -d johndoe@host.name.com:/home/projects/myproj/cvsroot \
import -m "" src foo bar
The project members can now start to add new files and make changes to files created by other members. New files can be added with cvs add filename, existing files modified and unwanted files removed with cvs rm -f filename. Modifications to the source tree should be reviewed with cvs diff -u before checking in the changes with cvs ci.
# cvs -d johndoe@host.name.com:/home/projects/myproj/cvsroot co src
# cd src
# vi extension.c
# cvs add extension.c # add a new file
# vi existingfile.c # modify an existing file
# cvs rm -f TODO # remove an existing file
# cvs update -dPA # what files were changed?
# cvs diff -u | less # see the modifications
# cvs ci -m "All TODOs implemented" TODO # remove the TODO file
# cvs ci -m "Added support for XYZ" # check in other files
# cvs update -dPA # update all files
16. Example: Project with third-party sources
In this example a new project is started based on some existing code. The code used in this project is Foo version 1.0.
The project administrator must first create the CVS repository. In this example all project files will be stored in /home/projects/myproj and only the project members can access that directory. The project members must be in the grpname group. Please note how the "set-group-id" bit is set with the chmod command.
[Done on the CVS server]
# mkdir -p /home/projects/myproj/cvsroot
# chgrp -R grpname /home/projects/myproj # change group
# chmod 2770 /home/projects/myproj # group writable
# cvs -d /home/projects/myproj/cvsroot init # create the repository
or
[Done remotely]
# ssh mylogin@host.name.com mkdir -p /home/projects/myproj/cvsroot
# ssh mylogin@host.name.com chgrp -R grpname /home/projects/myproj
# ssh mylogin@host.name.com chmod 2770 /home/projects/myproj
# cvs -d mylogin@host.name.com:/home/projects/myproj/cvsroot init
After creating an empty repository the project administrator must import the original Foo 1.0 sources into the FOO vendor branch. These source files will be located in the src/foo directory.
# cd /tmp
# tar xzf foo-1.0.tar.gz # extract the original files
# cd foo-1.0
# cvs -d mylogin@host.name.com:/home/projects/myproj/cvsroot import \
-I ! -I CVS -ko -m "Imported Foo 1.0" src/foo FOO FOO-1_0
The project members can now check out their own working copies and start making modifications and improvements. New files can be added with cvs add filename, existing files modified and unwanted files removed with cvs rm -f filename. Modifications to the source tree should be reviewed with cvs diff -u before checking in the changes with cvs ci.
# cvs -d johndoe@host.name.com:/home/projects/myproj/cvsroot co -P src
# cd src
# vi extension.c
# cvs add extension.c # add a new file
# vi existingfile.c # modify an existing file
# cvs rm -f config.log # remove an existing file
# cvs update -dPA # what files were changed?
# cvs diff -u | less # see the modifications
# cvs ci -m "Removed configuration log" config.log # remove the log file
# cvs ci -m "Added support for XYZ" # check in other files
# cvs update -dPA # update all files
Later when Foo 1.1 is released the project administrator can import the new release into the repository and merge changes made between versions 1.0 and 1.1 into the main developement branch (also known as HEAD).
[Import the new release]
# cd /tmp
# tar xzf foo-1.1.tar.gz # extract the new files
# cd foo-1.1
# cvs -d mylogin@host.name.com:/home/projects/myproj/cvsroot import \
-I ! -I CVS -ko -m "Imported Foo 1.1" src/foo FOO FOO-1_1
[Merge changes between official 1.0 and 1.1 releases into HEAD]
# cd ~/src/foo
# cvs update -d -kk -j FOO-1_0 -j FOO-1_1 # merge between 1.0 and 1.1
# cvs update | grep ^C # any conflicts?
[Fix possible conflicts]
# cvs ci -m "Upgraded Foo to version 1.1" # check in changes
# cvs update -dPA # update all files
Next time the project members update their working copies they will get the new Foo 1.1 sources.
In this example a new project is started from scratch.
The project administrator must first create the CVS repository. In this example all project files will be stored in /home/projects/myproj and only the project members can access that directory. The project members must be in the grpname group. Please note how the "set-group-id" bit is set with the chmod command.
[Done on the CVS server]
# mkdir /home/projects/myproj
# mkdir /home/projects/myproj/cvsroot
# chgrp -R grpname /home/projects/myproj # change group
# chmod 2770 /home/projects/myproj # make group writable
# cvs -d /home/projects/myproj/cvsroot init # create the repository
or
[Done remotely]
# ssh mylogin@host.name.com mkdir -p /home/projects/myproj/cvsroot
# ssh mylogin@host.name.com chgrp -R grpname /home/projects/myproj
# ssh mylogin@host.name.com chmod 2770 /home/projects/myproj
# cvs -d mylogin@host.name.com:/home/projects/myproj/cvsroot init
Next we need an empty directory which will be imported as a new "project". The project is called src in the following example. Please note that foo and bar are required but not really used as the imported directory is empty.
# mkdir /tmp/src
# cd /tmp/src
# cvs -d johndoe@host.name.com:/home/projects/myproj/cvsroot \
import -m "" src foo bar
The project members can now start to add new files and make changes to files created by other members. New files can be added with cvs add filename, existing files modified and unwanted files removed with cvs rm -f filename. Modifications to the source tree should be reviewed with cvs diff -u before checking in the changes with cvs ci.
# cvs -d johndoe@host.name.com:/home/projects/myproj/cvsroot co src
# cd src
# vi extension.c
# cvs add extension.c # add a new file
# vi existingfile.c # modify an existing file
# cvs rm -f TODO # remove an existing file
# cvs update -dPA # what files were changed?
# cvs diff -u | less # see the modifications
# cvs ci -m "All TODOs implemented" TODO # remove the TODO file
# cvs ci -m "Added support for XYZ" # check in other files
# cvs update -dPA # update all files
16. Example: Project with third-party sources
In this example a new project is started based on some existing code. The code used in this project is Foo version 1.0.
The project administrator must first create the CVS repository. In this example all project files will be stored in /home/projects/myproj and only the project members can access that directory. The project members must be in the grpname group. Please note how the "set-group-id" bit is set with the chmod command.
[Done on the CVS server]
# mkdir -p /home/projects/myproj/cvsroot
# chgrp -R grpname /home/projects/myproj # change group
# chmod 2770 /home/projects/myproj # group writable
# cvs -d /home/projects/myproj/cvsroot init # create the repository
or
[Done remotely]
# ssh mylogin@host.name.com mkdir -p /home/projects/myproj/cvsroot
# ssh mylogin@host.name.com chgrp -R grpname /home/projects/myproj
# ssh mylogin@host.name.com chmod 2770 /home/projects/myproj
# cvs -d mylogin@host.name.com:/home/projects/myproj/cvsroot init
After creating an empty repository the project administrator must import the original Foo 1.0 sources into the FOO vendor branch. These source files will be located in the src/foo directory.
# cd /tmp
# tar xzf foo-1.0.tar.gz # extract the original files
# cd foo-1.0
# cvs -d mylogin@host.name.com:/home/projects/myproj/cvsroot import \
-I ! -I CVS -ko -m "Imported Foo 1.0" src/foo FOO FOO-1_0
The project members can now check out their own working copies and start making modifications and improvements. New files can be added with cvs add filename, existing files modified and unwanted files removed with cvs rm -f filename. Modifications to the source tree should be reviewed with cvs diff -u before checking in the changes with cvs ci.
# cvs -d johndoe@host.name.com:/home/projects/myproj/cvsroot co -P src
# cd src
# vi extension.c
# cvs add extension.c # add a new file
# vi existingfile.c # modify an existing file
# cvs rm -f config.log # remove an existing file
# cvs update -dPA # what files were changed?
# cvs diff -u | less # see the modifications
# cvs ci -m "Removed configuration log" config.log # remove the log file
# cvs ci -m "Added support for XYZ" # check in other files
# cvs update -dPA # update all files
Later when Foo 1.1 is released the project administrator can import the new release into the repository and merge changes made between versions 1.0 and 1.1 into the main developement branch (also known as HEAD).
[Import the new release]
# cd /tmp
# tar xzf foo-1.1.tar.gz # extract the new files
# cd foo-1.1
# cvs -d mylogin@host.name.com:/home/projects/myproj/cvsroot import \
-I ! -I CVS -ko -m "Imported Foo 1.1" src/foo FOO FOO-1_1
[Merge changes between official 1.0 and 1.1 releases into HEAD]
# cd ~/src/foo
# cvs update -d -kk -j FOO-1_0 -j FOO-1_1 # merge between 1.0 and 1.1
# cvs update | grep ^C # any conflicts?
[Fix possible conflicts]
# cvs ci -m "Upgraded Foo to version 1.1" # check in changes
# cvs update -dPA # update all files
Next time the project members update their working copies they will get the new Foo 1.1 sources.