【问题标题】:How to control the file dates in git? [duplicate]如何控制git中的文件日期? [复制]
【发布时间】:2017-09-14 06:51:57
【问题描述】:

查看此存储库,https://github.com/steeve/france.code-civil/tree/master/Livre%20III/Titre%20VII 有48年前的文件……怎么办?

我可以在提交后保留旧日期吗?更改日期时 git 中没有冲突?

PS:本示例的目的是模拟文档时间并重现现实世界中的变化顺序。

【问题讨论】:

    标签: git file time


    【解决方案1】:

    您可以通过 git commit--date 参数来执行此操作。例如:

    git commit --date="Wed Feb 16 14:00 2037 +0100"
    

    您也可以编辑现有日期:使用git commit --amend

    欲了解更多信息,请查看Working with dates in git

    【讨论】:

    • 请注意,这适用于早在 1970 年的日期,即 Unix 时代的开始。 Git 无法记录在那之前的日期。
    猜你喜欢
    • 2018-02-21
    • 2012-01-21
    • 2017-05-05
    • 1970-01-01
    • 1970-01-01
    • 2010-11-29
    • 2018-07-10
    • 1970-01-01
    • 2014-07-30
    相关资源
    最近更新 更多