5
Apr

Update CVS Recursively

Here’s a trick that works with adding files recursively to CVS. Thanks to Torsten Curdt of vafor.org for this one:
http://vafer.org/blog/20050107005746

Basically, since there’s no way to tell the cvs add command to recursively search and add files to CVS, you must utilize other utilities like find,grep, and xargs. For the sake of convenience, I’m going to basically quote directly from the above website (to save on clicks):

find . -type d -print | grep -v CVS | xargs cvs add
find . -type f -print | grep -v CVS | xargs cvs add
cvs commit *

In summary, the find command is used to find the directories in the current working directory (.) and print them (-type d -print). The results are then piped into grep to remove any references to ‘CVS’ (-v CVS). These results are then piped into xargs where is executed for each result. This process is repeated for the files and then the changes are then committed to CVS (cvs commit *).

There are other recommended methods as well in the comments, like this one as well as this one (a MacOSX trick). I found that the already mentioned step works well, so that’s the one I’m going to suggest.

Feel free to donate if this post prevented any headaches! Another way to show your appreciation is to take a gander at these relative ads that you may be interested in:


There's 1 Comment So Far

  • Ashok
    May 27th, 2010 at 10:53 pm

    Great dude…

Share your thoughts, leave a comment!