<sshcrash.png>
I'm looking to use this in a script that imports old zip files to build a
repo and I'd like to fixup the commit date to be that of the last
non-ignored, added/modified file in the exported zip file. I can identify
the most recent file (e.g.)
$ git status -u --porcelain | sed -e "s/^...//" | xargs ls -t -c1 | head -1
But then doing a "ls -l --full-time <file>" produces a different format to
that shown in the git commit documentation e.g. "Wed Dec 28 16:30:27 2011".
The minimal system (msys) it doesn't appear have stat() etc.
Any suggestions for a suitable command?
I'm using a git bash window Git (version 1.7.8-preview20111206).
On Linux, I can use: stat --format=%Z the-file
I think we have GNU stat in msysgit, so it might work as well.
-- Hannes
Unfortunately stat looks to be not present in msysgit.
I got, for my example file.
Philip@PHILIPOAKLEY /d/MatlabPatchTestRepo (master)
$ stat --format=%Z ListTime.txt
sh.exe": stat: command not found
Use the 'date' command with the --reference option to take the time
from the referenced file. eg:
pat@FROG ~
$ date --reference=/c/opt/bin/putty.exe
Tue Nov 3 15:20:56 GMTST 2009
pat@FROG ~
$ date --reference=/c/opt/bin/putty.exe +"%s"
1257261656
pat@FROG ~
$ date --reference=/c/opt/bin/putty.exe +"%Y%m%d %H:%M:%S"
20091103 15:20:56
Lots of output options for you to try.