cvs(Concurrent Versions System) command in Linux is used to store the history of a file. Whenever a file gets corrupted or anything goes wrong “cvs” help us to go back to the previous version and restore our file.
cvs [cvs_options] cvs_command [command_options] [command_args]
- –allow-root=rootdir : Specify repository on the command line. It also specify legal cvsroot directory. See ‘Password authentication server’ in the CVS manual.
- -d, cvs_root_directory : It uses cvs_root_directory as the directory path name of the repository. It also overrides the $CVSROOT environment variable.
- -e, editor-command : It uses the editor command specified for entering log information. It also overrides $CVSEDITOR and $EDITOR environment variables.
- -f : It does not read the ~/.cvsrc file.
- -H : It display CVS command help.
- -n : It does not make any changes to the root repository and also prints out what would happen if the “-n” flag was not used.
- -Q : Quiet mode. Less verbose than normal.
- -q : Marginally quiet mode. Reports of recursion are suppressed.
- -v : Show CVS software version and copyright information.
- -w : Make new working files read-write. Overrides the setting of the $CVSREAD environment variable.
- add : Add a new file/directory to the repository.
- admin : Administration front-end for RCS.
- annotate : Shows the last revision where each line was modified.
- checkout : Checkout sources for editing.
- commit : Check files into the repository.
- diff : Show differences between revisions.
- edit : Get ready to edit a watched file.
- editors : See who is editing a watched file.
- export : Export sources from CVS, similar to checkout.
- history : Show repository access history.
- import : Import sources into CVS, using vendor branches.
- init : It create a CVS repository if it doesn’t exist.
- log : Print out history information for files.
- rdiff : Create ‘patch’ format diffs between revisions.
- status : Display status information on checked out files.
- tag : It adds a symbolic tag to checked out version of files.
- unedit : Undo anedit command.
- update : Bring work tree in sync wih repository.
- version : Show current CS version(s).
- watch : Set watches.
Setting up the environment for CVS:
- Set environment variables: (to add to your .bashrc file)
export CVSROOT='/home/linux/cvs_root' - directory for CVS source code repository export CVSEDITOR=/bin/vi
- Set environment variables: (to add to your .cshrc file) (for csh users)
setenv CVSROOT '/home/linux/cvs_root' setenv CVSEDITOR /bin/vi
- To create a Repository (-d command ): The first thing to do after starting the environment is to create a repository.
cvs -d /home/linux/cvs_root init
- To add a Project (-m command ): After the repository is created, It’s time to create a project and add it into the CVS to have it’s revision control.
cvs import -m "CVS START" cvs_file myfile start
- To check out a Project (checkout or co command): This will help to create CVS working copy after the project is check out.
cvs checkout cvs_file
- To add Sub-directories or files (add command ): This will help to add files or sub-directories to the CVS repository.
cvs add cvs_file_1
- To commit the file (commit command ): This will help to permanently add files or sub-directories to the CVS repository.
cvs commit myfile
- To update the Working Directory (update command): It updates the working directory from the repository and also tells the status of files.
- To remove file from CVS (remove command): It will help to remove unwanted files permanently from the CVS repository.
cvs remove myfile
- To check for the manual page of cvs command, use the following command:
- To check the help page of cvs command, use the following command:
cvs --help command_name
- tar command in Linux with examples
- arp command in Linux with examples
- gdb command in Linux with examples
- sum command in Linux with Examples
- bc command in Linux with examples
- id command in Linux with examples
- for command in Linux with Examples
- scp command in Linux with Examples
- ip command in Linux with examples
- tac command in Linux with Examples
- man command in Linux with Examples
- atq command in linux with examples
- atd command in Linux with examples
- fc Command in Linux with Examples
- yes command in Linux with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.