Steven Wu
Steven Wu

Reputation: 293

How to completely remove .svn files in Git

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.

Upvotes: 14

Views: 3256

Answers (1)

sjakubowski
sjakubowski

Reputation: 2943

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.

Upvotes: 22

Related Questions