Can I commit file modification changes with Git? For example, I touched the file test.txt (touch test.txt
) which changes the timestamp without changing its content. Now, can I commit this change in file modification time with Git?
I need to synchronize the timestamp of files between my local and remote repository.
The topic Restore a file's modification time in Git doesn't solve this problem. Actually they are complete opposite. While that topic talks about restoring timestamps after a successful commit, this topic wants to commit only the timestamp (not any change in content, which is not Git's default behavior), i.e a git commit
command should detect a change in the timestamp and perform commit even if there is no change in the content.
Ok, this is totally blue sky, but if you
clean filter
to build that file and commit itsmudge filter
to read that file and update timestamps on checkoutI think you could make this happen. Obviously it's totally roll-your-own, but it seems like a possibility.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With