简体   繁体   中英

how to delete .svn directory in not a working copy

I copyd a directory from a working copy, but found.svn directory in my copyd directory. I want to delete the.svn directory, I tried rm -fr.svn, but say Operation not permitted. So, how to delete those.svn directory? thank you

If it says not permitted it means that there is a problem with access rights. If you can, run as root.

Also, SVN keeps a .svn directory in each project directory. so, you'll have to do something like

sudo find -type d -name "*.svn" | xargs sudo rm -rf

Note: both uses of sudo above are needed only when there are problems with access rights

Why is this related to access rights? See here.

mihai@fomalhault:/tmp$ sudo mkdir test
[sudo] password for mihai: 
mihai@fomalhault:/tmp$ rm -rf test/
rm: cannot remove directory `test': Operation not permitted

Running a strace gives a

unlinkat(AT_FDCWD, "test", AT_REMOVEDIR) = -1 EPERM (Operation not permitted)

and this is what's reported

You can simpler create this by using the svn export command which export the whole working copy without the.svn folders. You can also export parts of your working copy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM