Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Say I have a lot of files that I want to add then check in at once. But consider that CVS folder should be excluded. What kind of command or script can be used in order to do this?

I have tried

find -name "*" -type f | xargs cvs add

to add files to repository, but it does not work. Any ideas?

Thanks!

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Try this to find all files in the current directory and add them to cvs:

find -maxdepth 1 -type f -exec cvs add {} \;

Another set to consider as arguments to find would be -not -name CVS if you wanted to exclude something by name (not necessary above because we are only looking at files, not folders).

share|improve this answer
    
But why xargs does not work? –  Narek May 19 '11 at 11:53
    
Likely because of issues with spaces in filenames. You have to be very careful how you use xargs. find […]|xargs -n1 -iX "X" cvs add might have worked by running one argument at a time and making sure it was quoted. Using -exec is an easier way to avoid that mess. –  Caleb May 19 '11 at 11:54
add comment

Try with something like:

find . -type f -a ! -wholename "*/CVS/*" -print0 | xargs -0 cvs add
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.