Created
March 22, 2017 08:07
-
-
Save andreipak/e00566e60d185680e8b56bb53a9201f1 to your computer and use it in GitHub Desktop.
Restore file's modification time in git [http://stackoverflow.com/questions/2458042/restore-files-modification-time-in-git#36243002]
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 | |
rev=HEAD | |
for f in $(git ls-tree -r -t --full-name --name-only "$rev") ; do | |
touch -d $(git log --pretty=format:%cI -1 "$rev" -- "$f") "$f"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment