Saturday 11 January 2020

CVS command Examples - Unix / Linux

LPI Tutorials and Materials, LPI Guides, LPI Learning, LPI Certifications

CVS (concurrent Version Control system) is a version controlling system used to record the history of the files. Whenever a code is changed in software, there might be chance of bugs creeping into that. With CVS, you can easily get the old version of the code and see what part of the code exactly created the bug.

In CVS, we can save every version of the file. The CVS only stores the differences between the files. This saves a huge amount of disk space.

The general syntax of CVS command is

cvs [option] filename

CVS Command Examples:

1. Checking out file


You can check out a file from the CVS repository with the checkout (co) option. This is shown below:

cvs co oracle_storage.dat

2. Adding a file to the repository


Use the add option to add a new file to the cvs repository.

cvs add mysql.bat

This will not commit the file to the cvs. It just simply adds the file.

3. Committing the file.


Once you have added a file to the CVS repository, you have to commit the file. Use the commit option with cvs command for committing a file.

cvs commit msql.bat

This will open an editor. Enter the comments and save by using the :wq.

4. Difference between files


You can find the differences between the local file with the latest version of the file in the cvs repository using the diff option.

cvs diff wireless.php

5. Update the file


You can update the local file with the latest version of the file from CVS repository using the update option.

cvs update -A network.dat

6. Update to particular version


You can get a particular version of the file from the cvs. Specify the version number of the file with -j option.

cvs update -j version-number network.bat

7. Adding binary files

You can add binary or image files to the CVS repository. Use the -kb option to add binary files.

cvs add -kb unix.png

8. Removing file from CVS

You can remove unwanted files permanently from the CVS repository using the remove option.

cvs remove linux_system.dat

After issuing this command you have to do a cvs commit. Otherwise the file will not be removed from the repository.

Related Posts

0 comments:

Post a Comment