Wednesday, January 9, 2008

version controls with cvs

0. I have a simple script to set my working CVSROOT. So when I work on it. I just run the script.

. cvs.sh

Here is cvs.sh script.(which is just 2 lines)

#! /bin/sh
export CVSROOT=":pserver:user:192.168.10.7:2401/home/repository"


1. Create a branch with tag.

cvs co -P -d foo FOO
cvs tag -b z_markc_unknown

To create a branch, you first need to check out the source code. here FOO is the module name and foo is the checkout directory.

2. Work on a branch.

cvs co -P -d foo -r z_markc_unknown FOO


3. Merge from a branch

cd foo
cvs update -j z_markc_1

It will merge the branch to where you currently work on (can be main trunk or a branch)

4. Commit your changes

cvs update
cvs diff Makefile
cvs commit Makefile

When you merge the code from a branch, it does not commit yet, so you need to commit it.

5. To delete a branch tag. (THIS SHOULD BE VERY CAREFUL!)

cd foo
cvs tag -dB z_markc_1