Git: Removing All .svn Files

I am just starting to get into git, so I’m still quite new with it. It definitely seems like it will end up being worth switching from svn to git.

I just started up a new Magento project, and the design/skin files that I received from the client were littered with .svn files. I hadn’t noticed that at first, so I ended up committing them. Here’s what I used to remove them all:

find . -type d -name '.svn' -exec git rm -rf {} \;

This entry was posted in Git, Magento. Bookmark the permalink.

5 Responses to Git: Removing All .svn Files

  1. walk_n_wind says:

    Thanks so much for sharing your command. Worked like a charm!

  2. Eduardo Mucelli Rezende Oliveira says:

    I would suggest the use of “[…] -exec git rm -rf –ignore-unmatch […]”

    Cheers!

  3. Sarah German says:

    So we meet again, Pratt! Found this thanks to the Google. I’m in the process of migrating projects from SVN to Git and just imported a bunch of SVN garbage into my fresh new Git repo by mistake. Thanks for the tip! And the new blog theme is very nice!

  4. loopion says:

    You can simply do an SVN export. No?

    • Josh Pratt says:

      loopion: Well, I wasn’t given an entire SVN project, just a number of directories that used to be in SVN. So I don’t think that would work.