Why do you want Vim to do this? This is what happens with commit before commit, see man githooks .
Update : it seems that gitattributes is the best option for this:
cd /path/to/repo echo "*.php filter=lastmodified" >> .gitattributes cat >> .git/config << EOF [filter "lastmodified"] clean = "sed -r -e 's/(.{,10}Last Modified:).*/echo \"\\1 `date +%F`\"/e'" EOF
source share