git - Checking out old file WITH original create/modified timestamps -
Is there a way to know or obtain original / modified timestamps? Thank you.
I believe that Git is the only timestamp writer recorded in the database and committed the timestamp. I did not find an option to commit to the most recent timing of the file's timestamp, and it would be understood that this will not be the default behavior (because if this happens, then Makefiles will not work properly) .
You can write a script to set the date of your recent commitments to the modified date of your files. It may look something like this: $ (git ls-files) for FILE in IFS = "" = <"> TIME = $ (git log - spety = format:% cd -n 1 - -date = ISO - "$ FILE") TIME = $ (date-j -f '% y-% m-% d% H:% M:% S% z' "$ TIME" +% Y% m% D% H% M .% S) Touch-m -T "$ TIME" "$ FILE"
Comments
Post a Comment