有没有办法让 TortoiseSVN 暂时忽略版本化文件? [英] Is there a way to make TortoiseSVN temporarily ignore versioned files?

查看:25
本文介绍了有没有办法让 TortoiseSVN 暂时忽略版本化文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们希望在版本控制中使用某些配置文件,因为它们指定了项目的默认设置:搜索路径、条件定义等.不幸的是,IDE (Delphi 5) 也使用这些文件来保存临时信息.IDE 在开发过程中不断更新文件,这导致 Tortoise 始终将工作目录标记为已修改,即使可能发生的只是项目的构建.有时我们确实想提交对这些文件的更改,例如,如果项目搜索路径依赖项发生更改,但在大多数情况下,它们只是噪音源.

We have certain configuration files which we want to be in version control as they specify project's default settings: search path, conditional defines etc. Unfortunately these files are also used by the IDE (Delphi 5) to hold temporary information. The IDE continually updates the files during development which causes Tortoise to flag the working directory as modified all the time even though all that might have happened is a build of the project. Sometimes we do genuinely want to commit changes to these files, for example if the projects search path dependencies change, but the grand majority of the time they are just a source of noise.

我的第一个想法是检出文件,在 TortoiseSVN 中应用全局忽略模式以忽略有问题的文件类型,并在我对要检入的代码进行真正更改时删除全局忽略.然而,如果一个文件的版本已经在存储库中,Tortoise 不会忽略它.

My first thought was to check the files out, apply a global ignore pattern in TortoiseSVN to ignore the offending files types and remove the global ignore when I have made a genuine change to the code I want to check-in. It appears however that if a version of a file is already in the repository, Tortoise will not ignore it.

有什么方法可以设置它,以便
1)文件在结帐时被拉入
2)有一些方法可以忽略对这些文件的更改
3) 如果需要,有一种方法可以检查文件的重大更改

Is there a way that I can set this up so that
1) The files get pulled in during a checkout
2) There is some means of ignoring changes to these files
3) There is an way of checking in significant changes to the files if required

推荐答案

允许对受版本控制的配置文件进行本地修改的一般解决方案不是将配置文件本身置于版本控制之下,而是对其模板进行版本控制,例如将 .template 附加到文件名.

The general solution to allowing local modifications to version-controlled configuration files is not to keep the config file itself under version control, but to version a template of it, e.g. with .template appended to the filename.

开发人员第一次签出项目时,会制作此文件的副本,从副本的文件名中删除 .template.然后他们将副本(非模板)添加到忽略列表中,以确保它不会被意外添加或提交.

The first time a developer checks out the project, they make a copy of this file, removing the .template from the filename of the copy. Then they add the copy (the non-template) to the ignore list to ensure it is not accidentally added or committed.

对需要进入版本控制的配置所做的任何更改都必须对模板进行.每次开发人员更新并发现模板中的更改时,他们必须再次遵循复制/重命名过程.但希望这不会经常发生.

Any changes that are made to the config which need to go into version control, must be made to the template. And each time a developer updates and finds a change in the template, they must again follow the copy/rename procedure. But hopefully this will not be often.

这篇关于有没有办法让 TortoiseSVN 暂时忽略版本化文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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