While migrating to a new machine, I ran into an unfun snag. My old machine (3+ years since a format) was using the old ‘_svn’ folder hack that ASP.NET 1.1 required instead of the standard ‘.svn’ folder. I didn’t want to use that on my new machine. Instead of just copying my project files over, I could have just checked the projects out fresh, but several are in the gigabyte size, and that didn’t sound like a lot of fun. Manually renaming 10,000 ‘_svn’ folders also didn’t sound like fun. So, instead, I modified the script described here into the script below:
@echo off call :recurse . goto :eof :recurse for /d %%d in (*) do ( pushd %%d attrib -H _svn >nul 2>nul ren _svn .svn >nul 2>nul attrib +H .svn >nul 2>nul call :recurse popd ) goto :eof
Just dump that in a batch file, plop it at the root of your SVN projects, run it, and you should be good to go.
In Powershell, this might look like:
gci -force -r | where { $_.psiscontainer -and $_Name -eq ‘_svn’ } | foreach { mv "$_.FullName" "$($_.FullName.Replace(‘_svn’, ‘._svn’))" }
A few notes:
– You’ve got to use -force since the _svn directories are hidden.
– It will complain about not being able to recurse into the ‘_svn’ directories after they’re renamed, but that isn’t a problem since they don’t contain any _svn.
– The $() around the Replace at the end makes it evaluate that expression rather than just return it as a literal.