I am trying to remove all .svn files and folders for my repo. I am using Git. But I downloaded the source from a server which came with all the nasty .svn files. I don't want to committ these. I have already created a .gitignore file to completely ignore .svn files but this isn't working.
I have already searched and read loads of answers on the web and on Stack Overflow. I tried using
find . -type d -name '.svn' -exec git rm -rf {} \;
To completely remove .svn files but they still linger. I am using Source Tree and tried Git Tower, but all the .svn files still appear as pending.
It maybe that I have previously accidentally committed a .svn file so its still appearing. Any clues how to ignore them totall or remove them would be a god send.
To remove a file from a Subversion repository, change to the directory with its working copy and run the following command: svn delete file… Similarly, to remove a directory and all files that are in it, type: svn delete directory…
There is only one . svn folder, located in the base of the working copy. If you are using 1.7, then just deleting the . svn folder and its contents is an easy solution (regardless of using TortoiseSVN or command line tools).
The find command returns a list of all the subfolders matching “. svn”, and this is then piped to the rm command to recursively delete the directory. Running rm using the full path will remove the confirmation prompt, and the “rf” arguments will recursively delete any folder contents.
Right click on the project, go to Team->disconnect. It will open a popup where you select the first option: 'Also delete the SVN meta-information from file system. ' This will remove all the SVN folders automatically along with svn property files that you might forget sometimes while removing .
find . -name '.svn' -type d -print0 | xargs -0 rm -rf
git commit -a -m "Deleting all .svn folders and files"
You can also update the .gitignore file afterwards.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With