CVS is a version control system. A version control system performs the task of tracking changes and versions of files. Usually, version control systems are mainly used by software developers.
A CVS Repository is a kind of virtual server for version control. A CVS Module resides in a CVS Repository and holds files and directories of a project or a sub project under version control with all their versioned history. A CVS Sandbox is a local copy of a CVS Module; it holds the files and directories from the CVS Repository in a particular version, usually the latest. A CVS Sandbox is created by Checking Out a CVS Module. The files in the CVS Sandbox are kept up to date by Updating the Sandbox regularly. Changes made within a Sandbox are made available to the co-developers by Committing them, which copies them to the Module in the Repository. The latest version is called CVS HEAD or simply HEAD. There are several possibilities to identify a particular version: A timestamp (date and / or time), a version or a label / tag.
CVS applies versions to individual files. CVS calls these versions Revision. Revisions start at 1.1.
When working with CVS, you'll work like this:
A module is a project(simply spoken).
cvs -d /home/cvsroot checkout myModulecvs -d :pserver:user@host:/home/cvsroot checkout myModulecvs -d :ext:user@host:/home/cvsroot checkout myModuleexport CVS_RSH=sshuser@ can be omitted. To execute the following commands, you must be in a sandbox.
cvs add filecvs commit filecvs add -kb file. cvs commit filecvs updatecvs update -dupdate -d. cvs diffOnly commit working changes.
Commit often, Commit early.
Write reasonable log entries.
The characters printed by the commands update and commit have the following meaning:
commit is required to permanently add the file to the repository.commit is required to permanently let the changes take effect.commit is required to permanently remove the file from the repository.mkdir /home/cvsrootcvs -d /home/cvsroot init Hints on permissions: chmod the repository 2770 or 2776 permissions. Create a group containing all users that should be able to access the repository (in the simplest case use users). If you want that only a module owner can delete a module, set the sticky bit, too, so use 3770 or 3776 then.
Even better use ACLs for permission control. It's recommended to assign repository ACLs after initialization only, so ACLs will affect normal modules but not CVSROOT. The following default ACL is suited: setfacl -m d:u::rwx -m d:g::rwx repository. Advantage: Users now only need to assign the appropriate group, everything else already is done. The default ACL will automatically be inherited on all newly created directories (modules). Exception: Sticky-Bit (makes sense not to inherit).
mkdir /home/cvsroot/myModule, don't forget to assign useful permissions (simpliest case chmod g+w module)./etc/services: cvspserver 2401/tcp # cvspserver cvspserver 2401/udp # cvspserverAdd the following line to
/etc/inetd.conf: cvspserver stream tcp nowait cvsowner /usr/sbin/tcpd /usr/bin/cvs -f --allow-root=/home/cvsroot pserver--allow-root=repositorylocation argument to enable remote access to more than one repository.