I have pulled a repository using TortoiseSVN. In it are .svn
folders in the root and all subfolders. I have created a github repository and pushed whole repository.
The problem is that in my local copy I have deleted the .svn
folders from repo and then commited the changes. It doesn't remove the folder from previous versions of repository...
I know how to remove sensitive data from github repo from here:
http://help.github.com/remove-sensitive-data/
But if I use this I have to follow this procedure more than 10 time (and it's such a waste of time to do that) ... so I was wondering that anyone can tell me how to delete all .svn
folders from the whole repo in a single go?
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…
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.
Browse to the directory in the repository and branch that you want to delete. In the top-right corner, click "…", and then Delete directory.
Just delete your complete local checked-out working copy (including all . svn directories). This will not modify your repository as you are not committing your deletion.
I needed to do this recently and I just ran the following command from my root directory of my repo:
find . -name '.svn' | xargs git rm -rf --ignore-unmatch
This searches recursively for all occurrences of the .svn folder and removes it and its contents recursively. the --ignore-unmatch
parameter prevents git from choking if it does not find the specified file in the repository.
The next thing to do, of course, is to add .svn to your .gitnore so that you don't mistakenly start tracking those files ever again.
Try this:
find . -type d -name .svn | xargs git rm -rf --ignore-unmatch
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