git clone changes file modification time

后端 未结 6 887
谎友^
谎友^ 2021-02-02 06:37

When I clone a git repository using \"git clone ...\" command all cloned files in my local repository have the same modification time with date and time when

6条回答
  •  伪装坚强ぢ
    2021-02-02 07:14

    Git does not record timestamp for the files, since it is a Distributed VCS (meaning the time on your computer can be different from mine: there is no "central" notion of time and date)

    The official argument for not recording that metadata is explained in this answer.

    But you can find scripts which will attempt to restore a meaningful date, like this one (or a simpler version of the same idea).

提交回复
热议问题