windows 如何使用 SVN 保留文件的时间戳?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4286633/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I preserve files' timestamps using SVN?
提问by Dawid Ohia
When I import files into a repository (svn import
), they get new timestamps. So when I checkout these files into a working copy, they have those new "last modification date". I would like to preserve the original files' timestamps. Is it possible with SVN 1.6.x?
当我将文件导入存储库 ( svn import
) 时,它们会获得新的时间戳。因此,当我将这些文件签出到工作副本中时,它们具有新的“上次修改日期”。我想保留原始文件的时间戳。SVN 1.6.x 可以吗?
回答by Wim Coenen
You can set the svn:date
revision property to simulate any commit time. See SVN commit with old date/timeand Change the timestamp of an SVN revision.
您可以设置svn:date
修订属性来模拟任何提交时间。请参阅SVN commit with old date/time和Change the timestamp of an SVN revision。
回答by BIBD
There is nothing in the default Subversion install to record the file's creation/modification dates. You may be able to add a custom property to record this if you wanted to go to that effort.
默认的 Subversion 安装中没有任何内容可以记录文件的创建/修改日期。如果您想这样做,您可以添加一个自定义属性来记录这一点。
The next best option is to use the "set the file dates to the last commit time" option that others have linked to. That'll get you the commit time which (in an ideal world) shouldn't be too long after the file was last updated.
下一个最佳选择是使用其他人已链接到的“将文件日期设置为上次提交时间”选项。这将为您提供提交时间(在理想情况下)在文件上次更新后不应太长。