Skip to content

Instantly share code, notes, and snippets.

@yuiseki
Created January 7, 2023 03:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuiseki/055d661a8a805ddafb6b718c90659508 to your computer and use it in GitHub Desktop.
Save yuiseki/055d661a8a805ddafb6b718c90659508 to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
for FILE in `git ls-files`; do
COMMIT_TIME=`git -c diff.renames=false log -m -r --no-color --pretty=format:%ci -z -n1 $FILE`
echo -e "$COMMIT_TIME\t$FILE"
TIMESTAMP=`date -d "$COMMIT_TIME" +"%y%m%d%H%M.%S"`
touch -t $TIMESTAMP $FILE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment