svn:ignore

Subversion ignore commands drive me up the wall.  Git’s ignore is much easier to use, and consistent.

Here is the process I followed to add svn:ignore to a newly added directory that hadn’t yet been committed to the SVN repo.  The magic here is the “-N” flag on the add command, since that stops the recursive add (which would add the git directories), and you can then set svn:ignore afterwards.

svn add active_scaffold_list_filters/ -N
svn ps svn:ignore ".git" active_scaffold_list_filters/
svn add active_scaffold_list_filters/*
svn ci

2 Comments so far

  1. Dave B on August 10th, 2008

    Further tricks:

    To remove .git files from the svn repo HEAD (they’ll still be in history, but that is harder to remove permanently, I believe you’d have to dump and scrub the repo):
    cd .git
    rm -rf `find . -type d -name .svn`
    cd ..
    mv .git /tmp
    svn rm .git
    svn ci -m “removed git files”
    svn pe svn:ignore . (to add ‘.git’ to svn:ignore)
    mv /tmp/.git .

  2. Zoxive on November 25th, 2009

    Thanks, this helped alot. I’m working with Kohana which uses a Git Repository for its core folder to stay up to date with updates.

Leave a reply