How to make SVN ignore a folder?
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 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.
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.
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?
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.
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.
精彩评论