svn 忽略而不删除文件? [英] svn ignore without deleting files?

查看:55
本文介绍了svn 忽略而不删除文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何忽略 svn 存储库中的文件而不删除它们?

how can I ignore files from my svn repo without deleting them as well?

当我处理现有项目时,我经常需要设置项目的本地版本并使用我的本地数据库.例如,使用 drupal,我检出 svn repo,更改 settings.php 文件以匹配我的本地数据库,但现在我必须确保我不会再次提交设置文件.

When I work on existing projects I often have to setup a local version of the project and using my local database as well. With drupal for instance, I checkout the svn repo, change the settings.php file to match my local database, but now I have to make sure I do not commit the settings file again.

有什么聪明的 svn 命令可以解决这个问题吗?

Is there any clever svn command that will fix this?

推荐答案

来自 SVN 帮助:

我的项目中有一个文件,每个文件开发人员必须改变,但我不希望那些本地 mods 永远是坚定的.我怎样才能使 'svn commit'忽略文件?**

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?**

答案是:不要将该文件置于版本控制之下.相反,放一个文件的模板在版本控制下,类似文件.tmpl".

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之后结帐",让您的用户(或您的构建系统)做一个正常的操作系统副本模板到正确的文件名,并让用户自定义副本.这文件是未版本化的,所以它永远不会做出承诺.如果你愿意,你可以将文件添加到其父目录的svn:ignore 属性,所以它不会显示为?"在 'svn 状态'命令.

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 忽略而不删除文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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