Removing all .svn Folders Recursively with find

 1 year ago
source link: https://www.devdungeon.com/content/removing-all-svn-folders-recursively-find
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Removing all .svn Folders Recursively with find

Submitted by NanoDano on Tue, 04/23/2013 - 11:36

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

The first part is the find, being called on the current working directory, designated by the single period. The -name flag specifies the file/folder name to search for. The -exec flag specifies that we want to run a command instead of having them listed. In this case we are calling the remove (recursive/force) on the files we found. {} in this case translates into the name of the found file. The semicolon is used to end the line, and the slash is just an escape character so it doesn't go to the shell.

You can use SVN export to create a clean version, but sometimes that isn't what you want, because a standard export will not include any unversioned files. There are occasions when you simply want to delete all the .svn folders recursively. That is one of the drawbacks of SVN versus Git. I would prefer having a single hidden folder in the root, like Git.


About Joyk

Aggregate valuable and interesting links.
Joyk means Joy of geeK