svn 忽略对 svn 持有/跟踪的文件的任何更改 [英] svn ignore anymore changes to a file that is held/tracked by svn

查看:37
本文介绍了svn 忽略对 svn 持有/跟踪的文件的任何更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些情况下,作为开发环境设置的一部分,某些文件以默认设置分发,并且这些文件被检入到 svn.但是我们不希望用户意外地对这些文件进行本地修改.

There are situations where as part of development environment setup, certain files are distributed with default settings and these files are checked in to svn. But we do not want the users to commit local modifications to these files accidentally.

svn 有没有办法做到这一点?我知道 svn:ignore 不适用于已经签入的文件.或者是否有不同的做法来实现相同的结果?

Is there a way possible in svn to do this? I am aware that svn:ignore does not work on files that are already checked in. Or is there a different practice to achieve the same results?

推荐答案

通常的方法是完全省略此类文件(通过 svn:ignore)并提交模板.用户应该复制模板并根据自己的喜好调整副本:

The usual approach is completely omit such file (via svn:ignore) and commit a template instead. The user is expected to copy the template and tweak the copy to his liking:

http://subversion.apache.org/faq.html#ignore-commit

答案是:不要将该文件置于版本控制之下.相反,把版本控制下的文件模板,例如文件.tmpl".

I have a file in my project that every developer must change, but I don't want those local mods to ever be committed. How can I make 'svn commit' ignore the file?

The answer is: don't put that file under version control. Instead, put a template of the file under version control, something like "file.tmpl".

然后,在最初的 'svn checkout' 之后,让您的用户(或您的构建system) 将模板的正常操作系统副本复制到正确的文件名,并让用户自定义副本.该文件是未版本化的,因此它将永远不要犯.如果你愿意,你可以将文件添加到它的父目录的 svn:ignore 属性,所以它不会显示为 '?'在svn status"命令中.

Then, after the initial 'svn checkout', have your users (or your build system) do a normal OS copy of the template to the proper filename, and have users customize the copy. The file is unversioned, so it will never be committed. And if you wish, you can add the file to its parent directory's svn:ignore property, so it doesn't show up as '?' in the 'svn status' command.

这篇关于svn 忽略对 svn 持有/跟踪的文件的任何更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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