NerdyHearn
Home
Blog

Contact
Mailing List

Software

Active Directory Products
Object Compare
Permission Compare

IPhone Products
Calls To Calendar
SMS To CSV
SMS To Gmail
Voicemail To Gmail

Sites
DocuTerminal
How Long For Me
My Music To Me
SaveMySerials
TypeCount

Blog
Twitter

NerdyHearn - Blog


<< Back To All Blogs

Recursively removing SVN bindings with PowerShell

Sunday, April 19th, 2009

I was up until 4AM last night because I had a catastrophic server failure on my SVN server. My SVN server had a mirrored raid volume, and one of the disks failed. I replaced the disk and was recovering the mirror when Windows blue-screened and the volume was corrupted completely beyond repair. Never a fun thing, but this is why I am so heavy on the backup process. I had a backup up until the previous night, but had done a bunch of programming during the day yesterday. I decided I would need to migrate the changes with my backup after restoring the repositories.

The bad part of this is that I only had my changes on the local SVN checkout of my repositories, and therefore needed to remove the SVN bindings and copy-over the checkout of my new SVN repositories. If you don't remove the bindings, SVN tends to do some very funky things, which result in a completely useless checkout.

PowerShell definitely came to the rescue for me on this one, I just ran this command, and all of my problems were solved:

Get-ChildItem -Include .svn -Recurse -Force | ForEach-Object { del $_.FullName -Recurse -Force }

This is assuming that your subversion metadata is stored in .svn folders (the default behavior). Older versions of TortoiseSVN may require that you change .svn to _svn. To view how your metadata is stored, go to your SVN checkout, go to the folder options, and select to view hidden and system folders and files.

I am continually loving PowerShell more and more, very impressive, very useful, very nerdy.

PowerShellin' Tom Out.

Tags

PowerShell SVN System_Maintenance

Related Blogs

Current file path in custom PowerShell Cmdlet
Customizing PowerShell for faster development with a default profile
Some Useful Powershell commands for the Linux nerds out there
Uninstalling PowerShell V1.0 from Windows Server 2003
Using Remote Powershell

Comments

Kevin said on Monday, April 20th, 2009 @ 9:01 AM

There's also SVNcleaner

Add A Comment

Name:


URL:


Email Address: (not public, used to send notifications on further comments)


Comments:



Enter the text above, except for the 1st and last character:


NerdyHearn - Latest tech news relating to C#, ASP.NET, SharePoint, PHP, general development, and more. DocuTerminal - Online Filing Cabinet solution. Scan, search and archive your paper documents. SaveMySerials - Protect yourself from theft, fire, natural disasters and more by recording your serial numbers My Music To Me - Stream your subsonic music collection to your Sonos wireless system TypeCount - Count how often you type across different computers! ServrTrackr - Monitor your SSL certificates, website uptime, and DNS configurations