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. 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.

  2. 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!

  3. Eduardo Mucelli Rezende Oliveira says:

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

    Cheers!

  4. walk_n_wind says:

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

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">