Exclude a file from SVN version control

svn exclude file from version control
subversion
subversion remove from repository
leave out of source code management
do not use in checkout of revision controlled repository

An actually useful bit of information:

Excluding/ignoring files

You can exclude files (e.g. *.o) from a directory by typing (in this directory):

svn propset svn:ignore *.o

To show the ignored files, type:

svn status --no-ignore

From: http://www5.epfl.ch/swis/page18243-en.html

However, I think you have to delete that file from your repository, or it'll still be checked out? Better safe than sorry, if you're trying to avoid overwriting a local settings file, for instance.

Based on the advice below, I would create templates with the suffix .copyme

That should be obvious enough!

Background from the Subversion FAQ:

http://subversion.tigris.org/faq.html#ignore-commit

I have a file in my project that every developer must change, but I don't want those local mods to ever be committed. How can I make 'svn commit' ignore the file?

The answer is: don't put that file under version control. Instead, put a template of the file under version control, something like "file.tmpl".

Then, after the initial 'svn checkout', have your users (or your build system) do a normal OS copy of the template to the proper filename, and have users customize the copy. The file is unversioned, so it will never be committed. And if you wish, you can add the file to its parent directory's svn:ignore property, so it doesn't show up as '?' in the 'svn status' command.

by Benjamin Melançon
Posted on Fri, 2007-06-15 07:25
in
svn propset svn:ignore problems

Hmm.

This:

svn propset svn:ignore settings.php

Resulted in this:

svn: Explicit target required ('settings.php' interpreted as prop value)

And this:

svn propset svn:ignore . settings.php

Gave me this:

svn: Cannot set 'svn:ignore' on a file ('settings.php')

Same thing happens even when settings.php is renamed or not there.

propset svn:ignore on a file?

Didn't quite sort this out.

Anyhow, ignore is only to keep it out of your svn status listings. All it does is make the file not show up

Posted by Benjamin Melançon on Sat, 2007-06-16 00:36
Same Problem

I am having the same exact problem :-S
If anyone knows how to correct this, please let me know at bowikaxu@gmail.com

Posted by Visitor on Sat, 2008-05-24 13:44
Go to main directory (that

Go to main directory (that has .svn directory) and issue command svn propset svn:ignore "settings.php" config/

That should do it.

Posted by Jussi (not verified) on Sat, 2008-06-28 15:42
Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <small> <pre> <strike> <sub> <sup>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.