git clone changes file modification time

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

    Adding to the list of one-liners ...

    for f in $(git ls-files) ; do touch -d $(git log -1 --format='%aI' "$f") "$f" ; done
    

提交回复
热议问题