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.