Latest

Archive

Community news

C++

Communities and Content

Databases

Editorials

Emacs

General

HTML

Java

Notices

PHP

XML

Apache

C++

Database

General

HTML

Java

Javascript

Linux

Object oriented programming

Open source

Perl

PHP

Python

Ruby

SOAP

XML

Suggest a link

Advertise on zez

Contribute

Contact us

About zez


Version Control management with CVS - Part 1



CVS is a Version Control System which helps multiple developers manage software projects. I'll not discuss whether or not CVS is the best choice over other free and commercial Version Control Systems, I'll instead show how CVS is used and give some small tips. This first part deals with setting up CVS locally, checking out a project and getting updates.

Setup

Before you start using CVS you'd better setup a couple of environment variables. All examples uses bash syntax.

First the CVS root needs to be set, this tells the CVS program were to look for projects unless another root is set explicitly. The CVSROOT variable consists of four items:
1. The protocol type, this can either be the use of pserver, remote shell execution (RSH and SSH) or locally.
2. The user name which has CVS access.
3. The server on which the repository resides.
4. The path on the server to the repository.

For instance using pserver, which is often used in local LANs, you could do

export CVSROOT=:pserver:user@server:/path/to/cvsroot

where user is your user on the remote server, server is the remote server and the /path/to/cvsroot is the path on the remote server.

You can also have the repository on your local machine in which case you write

export CVSROOT=:local:/path/to/cvsroot

where /path/to/cvsroot is the same as the one above but now locally. If you want to you can skip the :local: prefix since it is only needed on the MS-Windows platform where the path often contains a :.

The last and most used mode on the Internet is by using so called remote shell execution, this is done with either RSH (very insecure and not recommended) or with SSH. Before you use this you need to set another shell variable, namely CVS_RSH. To use SSH you would write

export CVS_RSH=ssh

you would then change the CVSROOT to

export CVSROOT=user@server:/path/to/cvsroot

where the user, server and /path/to/cvsroot is exactly the same as in the pserver example above.

One last thing you should do is to set the default editor for committing changes. If this variable is not set CVS will use vi for editing, so unless you're a vi fanatic you probably want to change it to something more sensible for you. Good editors for this kind of use are pico, nano or nedit. You can also use Emacs for this but I would recommend using the emacsclient, it saves a lot of loading time.
So to change it to use pico you simply perform this shell command:

export CVSEDITOR=pico


If you want these variables to be set each time you log in you can add them to your ~/.bashrc or ~/.bash_profile file.


| < 1 > | 2 | 3 | 4 | 5 | Next page >> | Printer-friendly page |

Comment List


There are no comments.


Forgot your password?

Register a new user

Results

Polls