Ignore files during svn commit

Subversion can ignore certain files when you attempt to commit. In NetBeans, it is just as simple as right click on the Locally Modified file in Subversion panel and choose Ignore option. On the command-line, you can see this section from the documentation. you can also configure the global-ignore property in Subversion’s configuration file.

6 thoughts on “Ignore files during svn commit

  1. Actually, as far as I can tell svn:ignore has nothing to do with commits specifically. It simply exclude’s a file’s (or directory’s) inclusion in subversion’s output when it’s not actually being tracked in the repository (for instance, in svn status). If you svn:ignore a file that’s being tracked by subversion, modify it, then commit the directory it’s in, it’s still going straight into the repository with all the modifications.

    I hate this. I DESPISE this.

  2. I do agree with you that the ignore feature isn’t very useful for our real world needs. Fortunately, I never find a need to use it with my style of commits. Unfortunately, other users on the same svn server kept getting tripped over this ignore property with the scenario that you described and that sometimes breaks my local build, a bit annoying. That’s why I tried to look it up and took a note of it when a person mentioned it. Again, thanks for sharing your comment.

  3. SVN ignore is useful for ignoring files which are not in the repo that get generated say during a local build, by running the software or by your editor/IDE (like those pesky emacs *~ or #*# files that hang around). That way you don’t have to see a bunch of ? marks in your svn status. It’s not useful for much else, but if you don’t explicitly add a file to the repo, it doesn’t get checked in. Just don’t ignore files from the repo! 🙂 A warning might be useful when ignoring a file that is in the repo, if that isn’t already implemented.

  4. To ignore a certain file from a SVN commit, do this.

    svn status | egrep ^M | sed ‘s/ */ /g’ | cut -f2 -d” ” | fgrep -v “file you don’t want” | xargs svn ci -m “my message”

    Easy, peezy.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s