I've played with CVS a little bit and am not the most familiar with all of its capabilities, but a huge annoyance for me is trying to add new directories that contain more directories in them. Running "cvs add
" only adds the contents of the current directory, and using "cvs import
" didn't look like the right thing either since it's still all code I'm producing (this howto claimed import is for 3rd party sources)
Do you guys know any way to recursively add everything in a given directory to the current CVS project (or if SVN or git makes this notably easier)?
Create the directory in a local workspace. cvs add <dirname> . That's it. Note that unlike adding files, which require a subsequent cvs commit , when adding a directory the add happens on the server as soon as you've done the cvs add so make sure you choose the right directory name.
Linux recursive directory listing using ls -R command. The -R option passed to the ls command to list subdirectories recursively.
An easy way to do this is to use find | egrep string . If there are too many hits, then use the -type d flag for find. Run the command at the start of the directory tree you want to search, or you will have to supply the directory as an argument to find as well. Another way to do this is to use ls -laR | egrep ^d .
I found this worked pretty effectively:
First, add all the directories, but not any named "CVS":
find . -type d \! -name CVS -exec cvs add '{}' \;
Then add all the files, excluding anything in a CVS directory:
find . \( -type d -name CVS -prune \) -o \( -type f -exec cvs add '{}' \; \)
Now, if anyone has a cure for the embarrassment of using CVS in this day and age...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With