git clone changes file modification time

后端 未结 6 893
谎友^
谎友^ 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:25

    A shorter variant of @Chris's answer that I find easier to understand:

    git ls-files | xargs -I{} git log -1 --date=format:%Y%m%d%H%M.%S --format='touch -t %ad "{}"' "{}" | $SHELL
    

提交回复
热议问题