add my usual script to touch files as git datetime

This commit is contained in:
Brian S. Stephan 2022-09-15 21:10:13 -05:00
parent 0344c59434
commit 2c23f950da
Signed by: bss
GPG Key ID: 3DE06D3180895FCB
1 changed files with 11 additions and 0 deletions

11
git-touch-all.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# touch files to match their last git commit timestamp
# "useful" for accurate display of page modified times after pulling changes in
git-touch() {
git ls-files --error-unmatch $1 > /dev/null 2>&1 && touch --date="$(git log -1 --format=%ci $1)" $1
}
for file in `find . -type f`; do
git-touch $file
done