如何使 svn diff 忽略某些文件?
我有一个实时系统和一个测试系统。该软件使用SVN进行版本控制。实时版本是一个特定的 TRUNK 修订版。
现在我想创建测试系统中的文件与实时系统中的文件的差异。我可以在测试盒上执行此操作
# svn diff -r 12345
,其中 12345 是实时系统的修订版。这按预期工作,但是该项目也将其配置文件放在 SVN 下,并且自然地实时系统不会与测试系统共享配置,因此我需要排除它。
我对 svn 不太熟悉,看起来没有开关可以专门排除文件/目录。
我想知道是否需要编写一个脚本来首先检查更改的文件,过滤该列表,然后提供 svn diff 的路径。
I have a live and a test system. The software is using SVN for version control. The live version is a specific TRUNK revision.
Now I'd like to create a diff from the files in the test-system to the live system. I can do this with
# svn diff -r 12345
On the test box where 12345 is the revision of the live system. That works as intended, however the project has put it's config file under SVN as well and naturally the live system does not share the config with the test system so I need to exclude it.
I'm not that well with svn and it looks like that there is no switch to specifically exclude files/dirs.
I'm wondering if I need to write a script for the job checking for changed files first, filtering that list and then provide the PATHs to svn diff
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
,它能够列出自特定修订版以来的至少所有修改以及本地修改
我创建了一个小 shell脚本
: sort -u
示例输出:
我现在可以使用
grep
过滤该输出,并将文件名用作xargs
的参数:要处理像 LC_MESSAGES 这样的二进制文件,我可以将其设置为使用替换 svn diff 命令:
使用
I created a little shell script that's able to list at least all modifications since a specific revision plus the local modifications:
Code:
echo "$FILES" | sort -u
Example output:
I can now filter that output with
grep
and use the filenames as parameters withxargs
:To handle binary files like the LC_MESSAGES, I could get it to work with replacing the svn diff command:
With