w3reference home
CVS Tutorial


Bookmark and Share

Remove Command

The remove command removes files and directories from a CVS repository.

Removing a file
Suppose, there is a file named try.txt in your repository as well as your working directory and you want to remove it from the repository. Let's see what the below command will do.

$ cvs remove try.txt
The output will be:
cvs remove: file `try.txt' still in working directory
cvs remove: 1 file exists; remove it first
Why did we get this output? The answer is that before you delete a file from the repository, you need to make sure to delete it from your working directory first. We use rm command for this.
$ rm try.txt
$ cvs remove try.txt
We will get a message like this:
cvs remove: scheduling `try.txt' for removal
cvs remove: use `cvs commit' to remove this file permanently
The remove command schedules a file to be removed but you need to commit it to actually delete it. So, the complete set of commands to remove the file, try.txt from the repository is:
$ rm try.txt
$ cvs remove try.txt
$ cvs commit -m "File is removed" try.txt
Removing a directory
There is no such command in CVS to delete an entire directory from the repository. But, you can do so by first removing all the files in that directory and then change the current directory to one level above and then run the update command with the -P option, which removes the empty directories.
$ rm new1.txt
$ rm new2.txt
$ cvs remove new1.txt new2.txt
$ cvs commit –m "Removed files" new1.txt new2.txt
$ cd
$ cvs update –P
The above commands will delete the directory containing the files, new1.txt and new2.txt.

Does remove command deletes the file from the repository?
No. The file is not physically deleted. It is only flagged as deleted and it can be recovered by using the combination of add and commit command.

Options of the remove command
-f
This option is used to forcibly delete the file physically as well.

Code Validator
Learn FTP
Color finder
Link Checker
Free web designs
Coming soon!
Interview Questions...
'w3reference : Learn by examples ... Advanced to beginner's tutorials ...'
Ajax: AJAX tutorial1 | Apache: Apache HTTP Server | Restarting Apache | CSS: CSS Border | CSS Syntax | CSS Selector | CSS Comment | CVS: CVS Release | CVS Login | CVS Logout | CVS Annotate | Databases: Rolap Tutorial | OLAP Tutorial | OLTP Tutorial | data warehousing | Expect: HTML: html | Linux: Dot (.) conf files | Linux Mount Point | Linux Filesystem | SSH Tutorial | Linux Commands: cal | cat | cfdisk | chroot | MySQL: MySQL Commands | PHP: PHP Basics | PHP Variables | PHP Output (echo/print) | PHP String Concat | PL/SQL: PL/SQL Data Types | PL/SQL Control Structures | PL/SQL File Extensions | PL/SQL DBMS_OUTPUT package | Python: My first Python program | Shell: Starting Bash | Bash Redirection | Bash Pipes | Bash Variables | SQL: SQL Transactions | SQL Constraints | SQL Drop | SQL Union & Union All | SVN: svn architecture | SVN Repository | SVN Import | SVN Checkout | Tech: soap | Web Designing: Web Hosting | HTML/XHTML/CSS code validator | Learn FTP | Search Engine Optimization Tips | www: XML: XML vs HTML | XML Syntax | XML Tags, Elements and Attributes | XML Namespaces |
Sitemap | Disclaim | Privacy Policy | Contact | ©2007-2009 w3reference.com All Rights Reserved.