Last active
January 13, 2023 16:56
-
-
Save johnl/0513b334ccaaba30e48962647def9bf6 to your computer and use it in GitHub Desktop.
Change file modification timestamps to the last git commit timestamps for all files in a git tree
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git ls-files -z | xargs -0 -n1 -I{} -- git log -1 --format="%at {}" {} | perl -ane '($t,$f)=@F;utime($t,$t,$f)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment