Shell Command - Remove SVN Folders - Jon Galloway

Shell Command - Remove SVN Folders

The Subversion source control client maintains your local state in hidden folders named .svn inside your project, which can be a problem if you want to copy or share the project directory.  This REG file adds "Delete SVN Folders" to the context menu for folders. When you select it, it removes all folders named .svn inside the folder and it's children (it does nothing if the project's not under Subversion source control.

I'm not going to bother explaining reg file installation here - I figure if you're using SVN, you're good with reg files.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
@="Delete SVN Folders"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
@="cmd.exe /c \"TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (.svn) DO RD /s /q \"%%f\" \""

I got the idea from Wyatt Preul's post comparing Powershell and Command Prompt commands to delete SVN directories, so if you'd like to do this manually take a look at his scripts. 

Published Saturday, February 24, 2007 2:30 PM by Jon Galloway
Filed under:

Comments

# re: Shell Command - Remove SVN Folders

Thanks, Matt. Looks like they're slightly different - SVN export copies your project to a new folder that's not under SVN control, and the "Remove SVN Folders" command I posted removes SVN control from the current folder.

Monday, February 26, 2007 1:58 PM by Jon Galloway

# re: Shell Command - Remove SVN Folders

Very nice, thanks for sharing.

Tuesday, February 27, 2007 1:24 PM by Scott Schecter

# re: Shell Command - Remove SVN Folders

SVN Export only exports files that are under SVN control. It will not export files set to ignore. This reg entry is a very cool way to clean up a copied SVN folder when you want to share the ignored files, too.

Thx for posting it.

Tuesday, February 27, 2007 2:47 PM by David Parsons

# re: Shell Command - Remove SVN Folders

Good idea, you may want to include _svn for ASP.Net developers. Not familar with cmd so not sure how you would add this myself though.

Wednesday, February 28, 2007 6:03 AM by Damien McGivern

# re: Shell Command - Remove SVN Folders

to ene genie toi papi..mu

Monday, September 10, 2007 6:16 AM by Ashvin Gunga

# re: Shell Command - Remove SVN Folders

so...cool~~~:>

it is a very useful tip.

SVN folders have always bothered me.

i don't worry about that owe to you

thanks~~

Monday, November 26, 2007 4:07 AM by vkimone

# re: Shell Command - Remove SVN Folders

It doesn't work :(

Thursday, December 13, 2007 10:02 AM by Dime

# re: Shell Command - Remove SVN Folders

Works perfect. Thanks!

Friday, January 25, 2008 5:39 AM by Kras

# re: Shell Command - Remove SVN Folders

It doesn't appear to work for me.

When I select a folder and right click -> DeleteSVN in the shell menu, it prompts me with the "Open With" dialog.

Thursday, January 31, 2008 12:11 PM by Brandon

# re: Shell Command - Remove SVN Folders

quick and dirty update to delete .svn and _svn :D

Thursday, March 6, 2008 9:34 AM by James Shaw

# re: Shell Command - Remove SVN Folders

Doesn't work for me.

Monday, June 2, 2008 1:07 PM by qed

# re: Shell Command - Remove SVN Folders

For the poster asking for help with removal of _svn files, append this to the end of the line in your reg file:

<B>&& FOR /r \"%1\" %%f IN (.svn) DO RD /s /q \"%%f\" \""</B>

Thursday, June 5, 2008 6:30 PM by Chax0

# re: Shell Command - Remove SVN Folders

Thats awesome! Takes 10 seconds to 'install', works right away and solved one of my biggest annoyances with SVN. Great!

Saturday, July 12, 2008 11:01 AM by Dready

# re: Shell Command - Remove SVN Folders

Does exactly what it says on the tin, thanks muchly.

Thursday, July 31, 2008 11:31 AM by Keith Lawrence

# re: Shell Command - Remove SVN Folders

Thankssssssssssss, nice one :-)

Friday, August 29, 2008 2:24 PM by timbo

# re: Shell Command - Remove SVN Folders

Thanks you soo much!

Thursday, October 16, 2008 5:25 AM by Anders Vindberg

# re: Shell Command - Remove SVN Folders

Thanks Jon this is really great.

I tried to modify the command so that it deletes all files except the svn ones.  The reason being I want to replace my project with the latest (unversioned) files, and want SVN to detect the changes.  If I simply overwrite the directory then deleted files (ie those existing in the old version but gone in the new) will go unnoticed.

Unfortunately my Windows Command skills are not up to snuff.  Can anyone help me?

Wednesday, October 29, 2008 1:09 PM by Inquisitive Coder

# re: Shell Command - Remove SVN Folders

This is just what I was looking for, tried it and it works a treat. Definitely a keeper.

-- Lee

Thursday, November 20, 2008 11:12 AM by Englestone

# re: Shell Command - Remove SVN Folders

Hi,

Getting an error for SVN Service how to resolve this

:  Error 1053: The service did not respond to the start or control request in a timely fashion.

Tuesday, April 14, 2009 12:30 AM by Bhaskar

# re: Shell Command - Remove SVN Folders

Worked great, needed to copy around 4 gigs of SVN downloads and they would never even start, once I cleared all the folders it only took a couple minutes :)

Friday, May 8, 2009 2:19 AM by Rad

# re: Shell Command - Remove SVN Folders

Very handy, thanks. Doing a *.svn search in Windows 7 and deleting was taking far too long (and it uses hidden/readonly for the folders too)

Tuesday, May 19, 2009 3:47 AM by Chris

# re: Shell Command - Remove SVN Folders

Thanks for that, saved my life now.

Friday, June 12, 2009 11:39 AM by sqlclient

# re: Shell Command - Remove SVN Folders

You saved my life on windows. However on Linux it is even simplier:D

find -type d -name '.svn'

Tuesday, June 30, 2009 10:49 PM by Techi

# re: Shell Command - Remove SVN Folders

Hey, could someone make a customized version of this to move the .svn files to a folder that the user specifies? Like in garry's mod, but only from the point that you right-click on. So if I click on the folder "C:\program files\steam\steamapps\<user name>\garrysmod\garrysmod" it'll export every .svn folder inside to the folder that the user specified but under the correct folder name. Like winrar does, if you export something from inside a folder, it exports it to a new folder with the name of the folder that your file was in and puts your file in that folder. This way I can know where my .svn's were in the beginning so I can put them back by simply overwritting ".../garrysmod/garrysmod" and then I can update my stuff. Do you know what I mean?

Friday, August 21, 2009 5:20 PM by Kyle

# re: Shell Command - Remove SVN Folders

Thanks for the post. Got me onto the right track for a bash command to do the same!

Thursday, September 17, 2009 12:36 AM by Allan Oliveira

# re: Shell Command - Remove SVN Folders

Thanks a lot, really useful and simple

Thursday, October 1, 2009 11:55 AM by adsf

# re: Shell Command - Remove SVN Folders

Thanks a lot. It saves a lot of time. Keep up the good work..........

Monday, October 19, 2009 4:24 PM by Kalpesh

# re: Shell Command - Remove SVN Folders

I've used it in my past 2 jobs and still using it. Very useful. Thank you.

Tuesday, October 27, 2009 12:52 AM by Kenny

# re: Shell Command - Remove SVN Folders

@Kurt Harriger

Awesome tip, saved me a big annoiyance!

Thursday, October 29, 2009 4:24 PM by John

# re: Shell Command - Remove SVN Folders

I've created a PowerShell script and cmdlet/snapin project for Remove-SVN.

Monday, November 30, 2009 9:52 AM by Andrew Badera

# re: Shell Command - Remove SVN Folders

The link to Wyatt Preul's post is broken

Monday, January 4, 2010 5:02 AM by wcoenen

# re: Shell Command - Remove SVN Folders

This rocks... very simple, very useful.

Wednesday, January 20, 2010 7:05 AM by Ralph Krausse

# re: Shell Command - Remove SVN Folders

для любителей сокса

Wednesday, January 20, 2010 12:29 PM by сокс

# re: Shell Command - Remove SVN Folders

На каком хосте у вас стоит блог? Шустро грузится...

Thursday, January 21, 2010 4:04 AM by guws3@mail.ru

# re: Shell Command - Remove SVN Folders

Отличный блог у вас, спасибо за интересный пост.

Friday, January 22, 2010 3:49 AM by guws5@mail.ru

# re: Shell Command - Remove SVN Folders

Gracias!!! Gracias!!! Gracias!!!

Thanks!!! Thanks!!! Thanks!!!

Grazie!!! Grazie!!! Grazie!!!

Obrigado!!! Obrigado!!! Obrigado!!!

Wednesday, February 24, 2010 12:36 PM by Julian Montagna

# re: Shell Command - Remove SVN Folders

ООО..давно искал. Забрал в букмарки. Автор, пишите почаще..не забрасывайте блог...Кстати не мешало бы диз поменять.

Monday, March 15, 2010 5:12 AM by Drormajok

# re: Shell Command - Remove SVN Folders

Отличный ресурс...примерно это я и искал.

Thursday, March 18, 2010 12:29 AM by Саня

# re: Shell Command - Remove SVN Folders

Хороший пост, бро...так держать!!!

Thursday, March 18, 2010 5:36 PM by Drormajok

# re: Shell Command - Remove SVN Folders

Хороший пост, бро...так держать!!!

Friday, March 19, 2010 12:02 PM by Drormajok

# re: Shell Command - Remove SVN Folders

Статья хорошая, только если бы ты оформил её немножко получше (добавил скрин-другой, или какой-нибудь арт) и заголовки сделал - тебе бы вообще цены не было :)

Saturday, March 20, 2010 1:48 AM by Drormajok

# re: Shell Command - Remove SVN Folders

Да ладно, чего к человеку пристали. Норм там всё с форматированием. Добавил в закладки ваш сайт.

Sunday, March 21, 2010 2:29 PM by Drormajok

# re: Shell Command - Remove SVN Folders

Баянистая тема..уже на куче блогов об этом пишут...Вы бы хоть пооригинальней это всё тогда завернули, чтоб читать интересно было. С уважением ваш читатель.

Thursday, March 25, 2010 4:48 AM by Fleerlyskence

# re: Shell Command - Remove SVN Folders

А мне понравилось, побольше бы таких постов в рунете..Спасибо автору.

Thursday, March 25, 2010 8:46 PM by Drormajok

# re: Shell Command - Remove SVN Folders

Блин, столько написал, а не отправилось...видимо глюк вордпресса. Вообщем забукмартил ресурс :)

Saturday, March 27, 2010 8:13 AM by Fleerlyskence

# re: Shell Command - Remove SVN Folders

+1 На всякий случай скопировал на жёсткий. Просьба к вам-пишите по чаще :)

Saturday, March 27, 2010 11:11 PM by Drormajok

# re: Shell Command - Remove SVN Folders

Буду краток-блог хороший. Желаю развивать в качественном направлении.

Friday, April 9, 2010 2:40 AM by ZoosqueSott

# re: Shell Command - Remove SVN Folders

Ух, сколько коментариев понаписали...не сочтите за спам, но и отпишусь и я. Хотелось бы чтоб более подробно описывали вопрос. А так всё понравилось. по крайней мере у вас чувствуется индивидуальный слог...

Friday, April 9, 2010 8:49 PM by ZoosqueSott

# re: Shell Command - Remove SVN Folders

Ty very much, awesome little registry key ;)

Saturday, June 5, 2010 10:40 AM by Maigel

# re: Shell Command - Remove SVN Folders

Thanks for the reg snippet! Timesaver!

Saturday, July 31, 2010 4:43 AM by Pete

# re: Shell Command - Remove SVN Folders

Great registry script. I tried on windows 7 and it works fine!

Tuesday, August 17, 2010 12:31 PM by Delete SVN Folders

# re: Shell Command - Remove SVN Folders

[b]Типография, Разработка дизайна, Москва (495) 972-0719.

Типография недорого (495) 9720719 Срочная печать визитки, листовки, верстка разработка дизайна, горячее тиснение кожи фольгой. [/b]

Saturday, September 11, 2010 4:11 PM by vteme

# re: Shell Command - Remove SVN Folders

Мне понравилось ровно виновник пишет.

Wednesday, October 6, 2010 9:22 PM by Borouphotte

# re: Shell Command - Remove SVN Folders

Hello!

You have the interesting news.

Continue in the same spirit.

Thanks!

ps:cool  name for your site -  weblogs.asp.net

Wednesday, October 20, 2010 2:49 AM by topoutrinue

# re: Shell Command - Remove SVN Folders

Сoберем для Ваc по сeти интeрнет базу дaнных

потенциaльныx клиентoв для Вашегo Бизнeca

(всe кoнтaктныe дaнные - род деятeльнocти,

назвaниe, адреc, именa, телефoны, фaксы,

е-mail, www итд)

Вы можете узнать пoдрoбнеe

по тeлeфoнy: +79lЗ39IЗ837

Wednesday, October 27, 2010 6:25 AM by GregoryBS

# re: Shell Command - Remove SVN Folders

1-22 мая, 2011 года приглашаем всех в Уникальный Йога-тур в Гималаи, с  одним из самых гибких людей планеты, сибирским мастером  Хатха-Йоги Владимиром  Калабиным и мастером Маха-Крийя-Йоги Евгением  Слогодским. В программе: техники Тибета Гималайской Йоги, посещение монастыря-резиденции  Далай Ламы в  Дхарамсале, Хатха-Йога для начинающих, Йога Ясного Света и Внетелесного Опыта посещения Бордо и многое другое. Стоимость путешествия 2 950 долларов, все включено. Наш сайт kalabin-yoga (точка) ru

Monday, November 1, 2010 8:17 AM by jhgfhghr

# re: Shell Command - Remove SVN Folders

coordinates mango leon bsdsnkjksa jovo manuscript basicomega offend jacques

Sunday, December 5, 2010 6:06 PM by gretrover

# re: Shell Command - Remove SVN Folders

marvelous!  ty u guys!

Thursday, December 30, 2010 2:48 PM by Heel

# re: Shell Command - Remove SVN Folders

Покупаем инструмент металлорежущий, мерительный, слесарный оптом,складские остатки организаций,  госрезерв, неликвиды инструмента, станочной оснастки, твердого сплава, мерительного инструмента,  гидравлики, пневматики, подшипников, станочного крепежа и и др. Покупка складов целиком, выезд на место, расчет сразу (любая форма).    

Покупаем сверла: КХ, ЦХ, все размеры.    

Фрезы отрезные, концевые, торцевые, червячные.    

Метчики, плашки, развертки, зенкера, долбяки, ножи к фрезам, сегменты и пилы 250 - 1430., резцы токарные.    

Оснастку: патроны токарные, цанговые, оправки, втулки, УДГ, плиты и др.    

СМИ (ключи, молотки), твердосплавные пластины      

меритель (микрометры, индикаторы, КМД, нутромеры и др.)    

пневмоинструмент марки ИП (гайковерты, дрели, и др.)    

Крепеж (штифты, гайки круглые, винты и др.)    

Любой объем. ulinstrument собака rambler.ru т.89176264475

Wednesday, January 5, 2011 6:16 PM by Expekeeft

# re: Shell Command - Remove SVN Folders

We can deliver flowers,cakes,chocolates and gift items to over

32 countries worldwide on the same day. Our wide network of florists,

quality assurance and timely delivery ensure that our

customers are satisfied. Having serviced over a million customers worldwide,

our company  gives a customer the power to express their emotions through flowers.

Saturday, January 8, 2011 6:07 PM by giftflowersindia

# re: Shell Command - Remove SVN Folders

Привет, я тут новенький, будем знакомы :)

Thursday, January 13, 2011 9:12 PM by vekCoesksailk

# re: Shell Command - Remove SVN Folders

Мне на кризис наплевать, вылез в топе гоу бухать

# re: Shell Command - Remove SVN Folders

sdf sdfsdfsdfsdfsdf sdfsd fsd

Wednesday, February 15, 2012 1:53 AM by Derek

# re: Shell Command - Remove SVN Folders

The Subversion source control client - yeap!

Monday, April 2, 2012 6:32 AM by Jon

# re: Shell Command - Remove SVN Folders

I visited several web sites except the audio quality for audio

songs present at this site is truly wonderful.

Sunday, May 12, 2013 5:00 AM by Sprague

# re: Shell Command - Remove SVN Folders

Состояние питьевой воды  в наше стране  сейчас

оставляет желать лучшего. Поэтому в каждом доме

непременно должен быть фильтр для воды.

С помощью этого надежного  бытового прибора вы

сохраните здоровье  вашей семьи.

Какова бы не была модель  фильтра для воды, он достаточно  основательно

очистит питьевую воду от всех  посторонних  примесей. Наша компания  реализует фильтры для воды в Сумах

и других городах Украины.

Friday, May 24, 2013 7:18 AM by extixtheash