Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN ignore files

Tags:

svn

I'm trying to ignore the file img/test.jpg from being followed by SVN. Prompted by this question I have tried the command:

svn propset svn:ignore "img/test.jpg" .

Instead of ignoring img/test.jpg, SVN tells me property 'svn:ignore' set on '.'.

Also, when I do svn status I now get the extra line:

 M      .

How can have SVN ignore a file?

like image 274
Randomblue Avatar asked May 30 '12 13:05

Randomblue


1 Answers

Despite confusing output, your command appears to have worked correctly. The line

M    .

...indicates that you have set a property on the current directory (the one you ran the command from). The ignored path is ./img/test.jpg, but the property is set on the current directory rather than the specific file. It has a modified flag M because you have yet to commit the property back to the repository. After you commit this, subsequent checkouts or others working on this codebase after svn update will also get the svn:ignore property on that file.

Note: To modify or remove this via svn propdel, you would need to do so from the current directory as well:

svn propdel svn:ignore .

You could have also cd'ed into the img/ directory and run the propset in there, in which case it would be bound to that directory rather than its parent. Your commit would then look something like:

M    img
like image 148
Michael Berkowski Avatar answered Oct 02 '22 16:10

Michael Berkowski