如何在 Subversion 中同步文件修改日期?
我已经为我们的网站创建了一个存储库。初始提交涉及文件修改日期,因此所有日期都显示提交日期。
后来,我将未修改的文件从 Web 服务器下载到我的 WC,因此旧的未修改文件现在与 Web 服务器中一样具有原始日期,并且我可以在部署期间将本地副本与生产和测试服务器同步。
现在我注意到存储库中的日期存在问题,并且我希望这样做,以便存储库中的文件修改日期与我的工作副本相同。有没有一种方法可以让我提交文件属性未修改的文件?
- 使用 tortoise svn
- 我不喜欢删除所有文件并进行大量提交的想法,尽管这可能不会对存储库大小产生真正的影响。
- 我知道我可以重建存储库,但这是一项非常肮脏的工作,尤其是在 Windows 上。
I've created a repo for our website. The initial commit touched file modification dates so all dates show the commit date.
In a later time, I downloaded the unmodified files from the web server to my WC so old unmodified files have their original dates now as in the web server and I can sync my local copy with the production and test servers during a deployment.
Now I noticed the issue with the dates in the repo, and I wish to make it so the file modification dates in the repo get same with my working copy. Is there a method so I can commit file properties of unmodified files?
- using tortoise svn
- I don't like the idea removing all files and making an enormouse commit, though this wouldn't probably make a real difference in the repo size.
- I know I could rebuild the repo, but this is a very dirty job, especially on Windows.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你不能使用 svn 并关心日期。必须选择其中之一。
话虽如此,
TortoiseSVN > 中有一个选项:设置>一般>将文件日期设置为“上次提交时间”
。这会产生提交日期,但不会产生最后更改的日期。要获得上次更改的日期,您必须摆弄提交挂钩。
TortoiseSVN >设置>挂钩脚本
。我使用过的唯一脚本是允许更改日志的脚本,因此无法帮助您。有关详细信息,请参阅以下问题:显然你无法设置单个文件的日期,但你可以 设置修订日期。该属性的名称是
svn:date
,我有一种感觉,更改它可能会产生一些副作用。所以,请注意。You can't use svn and care about dates. Must pick one of them.
Having said that there is one option in
TortoiseSVN > Settings > General > Set file dates to the "last commit time"
. This yields the date of commit, but not the date of last change.To have the date of last change you must fiddle with commit hooks.
TortoiseSVN > Settings > Hook Scripts
. The only script I ever used is the one that allows the change of the log, so can't help you with that. See following questions for more info:Apparently you can't set the dates of individual files, but you can set the date of the revision. The name of the property is
svn:date
, and I have a feeling that there may be some side effects of changing it. So, be warned.Subversion 没有这个功能,因为创建者认为它不重要。 Subversion 只考虑文件的名称、内容、执行权限,而不考虑文件元数据的这部分。
不幸的是,许多用户(包括我)使用 subversion 作为文件同步系统,它对于同步修改时间很有用。
10 年后编辑:我不再使用 Subversion 进行文件同步。
Subversion doesn't have this capability because the creators didn't think that it was important. Subversion only considers a file's name, contents, execute permission, but not this part of file metadata.
It's unfortunate, many users (including me) use subversion as a file synchronization system, and it's useful to synchronize modification times.
EDIT FROM 10 YEARS LATER: I no longer use Subversion for file synchronization.