如何使SVN地址忽略的二进制文件 [英] How to make SVN ADD ignore binaries

查看:867
本文介绍了如何使SVN地址忽略的二进制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

二进制文件(在Linux下)不具有扩展名,所以我不能使用模式排除。因此,当我使用 SVN增加添加目录,我会得到的东西像

Binaries (under Linux) don't have an extension so I cannot exclude them using patterns. Thus when I use SVN add to add a directory I will get something like

$ svn add recursion_vector/
A         recursion_vector
A         recursion_vector/rec_vec.cxx
A         recursion_vector/rec_vec.h
A  (bin)  recursion_vector/rec_vec

下面 rec_vec 是我想排除的可执行文件。 SVN显然它识别为二进制文件。现在,我可以告诉Subversion忽略所有二进制文件?

Here rec_vec is the executable I would like to exclude. SVN obviously recognizes it as binary. Now can I tell Subversion to ignore all binary files?

推荐答案

这是一个有点冗长,因为它使用发现:

This is a bit verbose because it uses find:

找到[TARGET目录] \\(-executable型的F \\)-prune -o -print | xargs的使用svn添加--depth空

传递目标目录查找,发现将递归的目录打印出所有内容,除了可执行文件( \\(-executable型的F \\)-prune )。如果没有型的F 找也将删减目录,因为这些通常有执行位或搜索位集。

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.

- 对深空选项添加告诉使用SVN本身递归一个文件对象,因为发现是处理递归。

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

如果你喜欢的结果,你可以把这个shell函数,它会让你在传递参数的 [TARGET目录]

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

感谢您,

扎卡里

这篇关于如何使SVN地址忽略的二进制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆