My Tech notes: Using "cvs add" recursively instead of "cvs import"

Unix Documentation

Free Online Unix Training Materials

Lists many links to free Unix training materials.

Pointers and Arrays Materials

Pointers and Arrays materials Explained for C beginners

C FAQ and General Questions C Interview Questions

Powered By

Free XML Skins for Blogger

Powered by Blogger

Tuesday, June 24, 2008

Using "cvs add" recursively instead of "cvs import"

You can use "cvs add" command to check-in any big source like linux kernel instead of "cvs import" since the "cvs import" command is creating branches with versions instead of 1.1.

Suppose you want to check-in a large source which is inside a folder name “newfolder”.

To add the folder “newfolder” and it sub-directories into CVS first do

$ find newfolder –type d –print | xargs cvs add

Then to add the files inside the “newfolder” and its subdirectories

$ find newfolder –name CVS –prune –o –type f –print | xargs cvs add

Then we have to commit these into CVS. The “cvs commit” is recursive, so we can give the following command

$ cvs commit –m “comment” newfolder/.

NOTE Please verify if everything has been checked in with these steps by checking out and compiling. I found some files (only which are last) didn’t get added while doing so for kernel. This might be due to very large number of files in kernel source. This is a one time effort and very easy to maintain.


No comments:

Post a Comment