From 2c23f950da0250584dd0fd87767a3707981ff563 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Thu, 15 Sep 2022 21:10:13 -0500 Subject: [PATCH] add my usual script to touch files as git datetime --- git-touch-all.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 git-touch-all.sh diff --git a/git-touch-all.sh b/git-touch-all.sh new file mode 100755 index 0000000..c7a89be --- /dev/null +++ b/git-touch-all.sh @@ -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