Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"svn add *" adds even those files which are ignored

Tags:

ignore

svn

I am using svn add * to add files to the svn, and it adds the config file which is for sure added to ignore.

lyuba@lyuba-laptop:/workspace/project$ svn propget svn:ignore
.sass-cache
config.js

What can cause the problem?

like image 218
lyuba Avatar asked Nov 05 '10 14:11

lyuba


1 Answers

Super old Question but I ran into this issue just now and the solution I found is not listed here. Adrian Smith's answer is on the right track. I assume the docs and SVN itself have seen many updates in 5 years. Here is what I found in the SVN docs

Even if svn:ignore is set, you may run into problems if you use shell wildcards in a command. Shell wildcards are expanded into an explicit list of targets before Subversion operates on them, so running svn SUBCOMMAND * is just like running svn SUBCOMMAND file1 file2 file3 …. In the case of the svn add command, this has an effect similar to passing the --no-ignore option. So instead of using a wildcard, use svn add --force . to do a bulk scheduling of unversioned things for addition. The explicit target will ensure that the current directory isn't overlooked because of being already under version control, and the --force option will cause Subversion to crawl through that directory, adding unversioned files while still honoring the svn:ignore property and global-ignores runtime configuration variable. Be sure to also provide the --depth files option to the svn add command if you don't want a fully recursive crawl for things to add.

The short version is use svn add --force . This works perfectly for me.

like image 52
Mike Borman Avatar answered Nov 11 '22 13:11

Mike Borman