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

  • Can I mark a branch as 'not going to push'?
  • how do I determine the parent parent repository of a git repository?
  • How can I provide a 2-way mirror of a Git repository with another SCM? (bzr, hg etc)
  • “git fetch” does not work
  • How are you structuring your Git repository workflow?
  • Why Kiln is based on Mercurial, and not other (D)VCS
  • 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.

  • Can GIT behave like SVN?
  • Update all git repos in a folder in windows
  • (Git Merging) When to use 'ours' strategy, 'ours' option and 'theirs' option?
  • avoid git adding dotfiles, hidden file and tempfiles
  • SVN Repo in vendor with Composer
  • Ubuntu Linux git gc says error: failed to run repack
  • 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.