Page 1 of 1

Bash

Posted: 07 Aug 2007, 00:02
by Tim Blokdijk
Anybody here that would know how to remove the ".svn" dir (and all files in it) from the current and all sub-directory's with bash?

Posted: 07 Aug 2007, 00:04
by Kloot

Code: Select all

find . -name *.svn* | xargs rm -r

Posted: 07 Aug 2007, 00:15
by det
That will break of any of the directories contain spaces. I would reccomend:

Code: Select all

find -type d -name ".svn" -exec rm -rf "{}" ";"

Posted: 07 Aug 2007, 01:06
by Acidd_UK
Just to show off, how about:

Code: Select all

for SVN_DIR in `find . -type d -name .svn`; do rm -rf $SVN_DIR; done

Posted: 07 Aug 2007, 08:50
by det
That will also break if any of the directories contain spaces :-)

Posted: 07 Aug 2007, 09:24
by Auswaschbar
I dont know what you need it for, but what about "svn export":

Code: Select all

svn export ./ /tmp/svn_without_svn_dirs

Posted: 07 Aug 2007, 12:20
by AF
[10:58:15 AM] <Forum> ( <td widt° 56' N, 11° 35' O</span><br /></td>) Linux -> Bash : http://tinyurl.com/2ukkge
[11:19:01 AM] <Forum> ( <td widt° 56' N, 11° 35' O</span><br /></td>) Linux -> Bash : http://tinyurl.com/2ukkge

Your post breaks forumbot

Posted: 08 Aug 2007, 13:58
by Tim Blokdijk
Thanks for the reply's :-)

I'm trying to set up an effective and automated site development environment at newspring.clan-sy.com.
The idea is to have a script to replace the site with a svn revision of choice.
So the script would do a checkout of the www-root dir in svn and move it to the site dev. env. remove the .svn stuff update the database and copy extra data like the forum avatars and wiki pictures to it.

Posted: 08 Aug 2007, 14:41
by det
Then what Auswaschbar suggested is correct. Just use "svn export" to check out from the repo without the ".svn" dirs.

Posted: 08 Aug 2007, 14:47
by Tim Blokdijk
I think so to but it's nice to have an alternative to.