tags:

views:

394

answers:

5

I want to make SVN ignore everything that is in my wordpress directory. It bring me nothing but headaches because of auto updates to plugins etc.

When I...

svn propedit svn:ignore ./blog

It tells me...

svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set, and no 'editor-cmd' run-time configuration option was found

So I...

[phil@sessions www]$ export SVN_EDITOR=emacs
[phil@sessions www]$ svn propedit svn:ignore ./blog

But I don't know what to put in here to make it ignore.

A: 

If you don't specify the property in command line, SVN will try to open your editor to let you modify attributes.

You can either:

  • Specify the attribute on the command-line:

    svn propset svn:ignore "*" ./blog

  • Export your editor name in SVN_EDITOR, and when svn opens your property list, just add patterns separated by new lines.

Aurélien Vallée
Doing that gets me this:property 'svn:ignore' set on 'blog/wp-content/themes/mytheme'[nextoddren@sessions public_html]$ svn commit -m "commit"svn: Commit failed (details follow):svn: Aborting commit: '/usr/local/apache/sites/myworkaddress/blog/wp-content/themes/mytheme/header.php' remains in conflict
pg
+2  A: 

To instruct Subversion to ignore a directory, you must edit the properties of the parent directory. So if blog is your Wordpress directory that you want to ignore, do:

[phil@sessions www]$ svn propset svn:ignore blog .

The arguments of propset are PROPNAME, PROPVAL, and PATH. So this sets the svn:ignore property on . (the current directory) to blog.

Of course you may choose to use propedit instead of propset if you want to edit the existing value in an interactive editor.

Greg Hewgill
thank you very much!
pg
Wait, I thought this worked but when I did this and then commit -M "some stuff" it just gives me the prompt again whether there are changes in the blog folder or anywhere else.
pg
[phil@sessions www]$ svn commit -m "some changes" just gives me the $ prompt again.
pg
If `commit` is not doing what you expect, run `svn status` first to see what Subversion believes has changed. If this doesn't match your expectations, then I suppose that's another question entirely.
Greg Hewgill
+1  A: 

I am not sure but can you just delete the folder from SVN?

svn --keep-local delete path/to/folder

This deletes it from SVN but keeps it in your working copy.

But I am not sure if the local copy stays with the next update and I guess this svn:ignore is a cleaner approach?

Felix Kling
A: 

svn propedit svn:ignore ./some_path tells svn that you want to ignore things under the some_path directory.

For example if there are 2 files under ./some_path, and you wanted to ignore both, you could enter

foo
bar

If you want to ignore foo but not bar, just enter

foo

Finally, it understands wildcards, so if you wanted to ignore everything under ./some_path, you could enter

*

So, if you would like to ignore everything under ./blog, I think * should do the trick.

Dave Paroulek
Wait I accidentally set a property called "blog" on all the files in the top level directory. How can I remove svn properties?
pg
Will this recursively ignore everything in the folder?
pg
A: 

A lot of other questions have covered this ground already (search "[svn] ignore"; too lazy to link them all), but the key thing that isn't emphasized enough in the docs is that svn:ignore only applies to items that do not exist in the head version of the repo. So if you want svn:ignore to apply to something that you've already (accidentally) checked in, you need to svn delete the item first, to get it out of the repo. See if that fixes your problem.

Coderer