How to make SVN ADD ignore binaries

懵懂的女人 提交于 2019-12-05 07:30:37

This is a bit verbose because it uses find:

find [TARGET-DIRECTORY] \( -executable -type f \) -prune -o -print | xargs svn add --depth empty

Passing the target-directory to find, find will recurse the directory printing out all the contents except for executable files (\( -executable -type f \) -prune). Without -type f find would also prune directories since these usually have the execute bit or "search bit" set.

The --depth empty option on add tells svn not to itself recurse a file object, since find is handling the recursion.

If you like the result, you can put this in a shell function that would allow you to pass in arguments for [TARGET-DIRECTORY].

Thank you,

Zachary

Can you set up a pattern match to exclude filenames that don't have a . in them?

This is not exactly what you want (and you might already know this answer)... but anyway :

You can set exclude patterns to ignore some files based on the filenames. More info in the great SVN book :

http://svnbook.red-bean.com/en/1.1/ch07s02.html#svn-ch-7-sect-2.3.3

Other than that, it might be possible to do something with commit hooks, but I have no experience with those ...

Good luck !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!