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

  • Git equivalent of “hg id”?
  • Migrating away from Clearcase
  • git cherry confusion - doesn't work as described in doc
  • When using a DVCS in front of Subversion should I merge or rebase before pushing?
  • Version control for subtitle creation
  • How can I provide a 2-way mirror of a Git repository with another SCM? (bzr, hg etc)
  • 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.

  • How to Link 1 git repository to some other repositories?
  • Excluding the arrow pattern “->” using grep
  • Is there anyway to import XCode snapshots into a new SVN repository?
  • Git merge - manual merge - forcing conflic having WHOLE old and new file version
  • What's the Git command to determine which commit changed a submodule pointer?
  • How to commit changes to git in Concourse build?
  • One Solution collect form web for “How to completely remove .svn files in Git”

    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.

    Git Baby is a git and github fan, let's start git clone.