Recursively adding files to CVS
The following commands can become handy if you are still stuck with cvs and cannot use the excellent eclipse cvs client.
find . -type d -print | grep -v CVS | xargs cvs add
find . -type f -print | grep -v CVS | xargs cvs add
It is really a great solution. Thanks a lot for reducing my work.
Thanks, this is fantastic
It did not work for me as specified under bash on OS X, I had to use the following, and note the -n1 parameter for xargs:
find . -type d -print | grep -v CVS | xargs -n1 cvs add
find . -type f -print | grep -v CVS | xargs -n1 cvs add
the -n1 ensures that cvs add is called only for a single file each time. That’s required because while cvs add can be called with a number of files as argument, if one of the arguments “aborts” the add, the others won’t be added. I found that to happen with the first line which adds the directories. If a directory is already there, cvs add aborts instead of just skipping it like it does with files.
So it would do a cvs add dir1 dir2 dir3, but because dir1 was already in the repository, it would not add dir 2 and 3. I am not sure it’s required for files, but it can’t hurt.
Thanks guys this is just what I needed. Don’t have eclipse setup on my mac. :(
thank you, thank you, thank you. awesome.
I love it.
Thanks!