commit with filesystem date
[sxmo-sms-ssh] / git-commit-date
diff --git a/git-commit-date b/git-commit-date
new file mode 100755 (executable)
index 0000000..54e196b
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh -x
+
+# preserve file timestamp in git date inside commit
+# usage: git-commit-date path
+
+git commit --date="$( ls --full-time $1  | awk '{ print $6" "$7 }' )" $1
+