#!/bin/sh # post-checkout hook that changes timestamps on files to that one of the commit # if branch was changed prev_HEAD="$1" new_HEAD="$2" new_branch="$3" if [ "$new_branch" = 1 ]; then commit_date="`git show --format='%cD' \"$new_HEAD\" | head -1`" && touch --date="$commit_date" `git ls-files --cached` fi exit 0