9 Dec 2003

Ever had to manually go through a large project and delete all the CVS folders in it because you didn't export it and the module no longer exists in CVS? If all you have is a workspace copy and you want to add it back to CVS (perhaps a different CVS server), then you can either painstakingly delete the CVS folders manually or you can buy me a beer as thanks for this little nugget:

FOR /r /d %D in (CVS*) do @rmdir /q /s "%D"

In Windows, go to the root directory of your project, enter the line above into the command prompt and all your CVS directories will be gone :) (Disclaimer: Be careful with wildcard deletes like this -- double check that you've entered it correctly, that you're in the right directory and that you have no other directories that begin with "CVS". Don't come banging at my door if you accidentally wipe out your hard-drive!)

Of course, the best thing is never to get into these situations. You can easily use a tool like Tortoise CVS (or the command line) to Export a copy of your project without the CVS directories.

Creative Commons LicenseThe Goodbye CVS! article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.

Add Your Comment

Spam Protection by WP-SpamFree

Goodbye CVS!

  1. [...] I’ve used Aral Balkan’s command from this link though it wasn’t working for me, because my CVS folders were read only and hidden. If your CVS folders aren’t hidden then I recommend you use Aral’s approach which is much faster. [...]

    Daniel Tome’s blog » Delete CVS files
  2. I know you no longer use windows anymore, but this command wasn’t deleting the hidden CVS folders. I’ve updated the command to also delete the hidden CVS folders:

    for /f “tokens=*” %%i in (’dir /b/a/s CVS*’) do @rmdir /q /s “%%i”

    It might be useful for someone.
    I’ve also posted some info to add to the windows explorer context menu:

    http://danieltome.com/index.php/2007/01/13/delete-cvs-files/

    If you’re ever coming down under near Sydney, let me know and I’ll buy you a beer ;-)

    cheers,

    Daniel Tome
  3. Thanx to both of you, come to india you will get a dinner for this :)

    amar
  4. Thanks Buddy :)

    It saves me lot of time.. I surely by u a beer !! :) ;)
    Come to India.. :)

    Cheers,
    Kedar

    Kedar