Monday, April 20, 2009

Commonly Used Basic CVS commands

Commonly Used Basic CVS commands

The overall format of all cvs commands is:

cvs [ cvs_options ] cvs_command [ command_options ] [ command_args ]

cvs_options
Some options that affect all sub-commands of cvs. These are described below.

cvs_command
One of several different sub-commands. Some of the commands have aliases that can be used instead; those aliases are noted in the reference manual for that command. There are only two situations where you may omit cvs_command: cvs -H elicits a list of available commands, and cvs -v displays version information on cvs itself.

command_options
Options that are specific for the command.

command_args
Arguments to the commands.

Basic CVS commands

1. CVS uses CVSROOT environment variables for the location of the repository. set this first as follows in you .profile file.

CVSROOT=/home/username/cvsrepositname
export CVSROOT



2. Now initialise the repository

cvs -d /home/username/cvsrepositoryname init (If CVSROOT is not Set)
cvs
init (If CVSROOT is Set properly)



3. Import the "project" (one or more files) into the CVS repository for incorporateing source files from another directory into your repository

cvs
import -m "Import Message" projectname username release-tag



4. Add new file into repository:

cvs add dirname/filename
(will be effective only after cvs commit command is issued.)



5. For deleting a file from the repository, (first delete it from your working directory before issuing the following command).

cvs remove dirname/filename
(will be effective only after cvs commit command is issued.)



6. status check for a file in the repository.

cvs status filename



7. For working on files in the repository:

cvs checkout dirname (This will check out the complete directory's files for working)
cvs checkout dirname/filename (This will check out the specific file of the directory for working)



8. For Submitting/commiting the file back to the resposity one modification is done.

cvs commit -m "Commit Message" dirname (This will COMMIT the complete directory's files for working)
cvs commit -m "Commit Message" dirname/filename (This will COMMIT the specific file of the directory for working)



9. getting the latest copy of the file from the CVS resposity

cvs update filename



10. CVS log command for change history

cvs log filename







Earn/Make Money Online