#! /bin/sh # Recursively find commit date/time for every known file in the repository # and set the file's modification time to that date/time. git ls-tree -r --name-only HEAD | while read filename; do touch --date="`git log -1 --format=\"%cD\" -- \"$filename\"`" "$filename" done