#!/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