Restore a file's modification time in Git

后端 未结 9 1560
猫巷女王i
猫巷女王i 2020-11-29 01:13

I understand the default Git behaviour of updating the modification time every time it changes a file, but there are times when I want to restore a file\'s original modifica

9条回答
  •  感动是毒
    2020-11-29 01:39

    I wrote a little tool that will allow you to restore the modification time of the files in a directory after doing a merge or checkout with Git.

    https://bitbucket.org/chabernac/metadatarestore/wiki/Home

    Use the tool as a hook in Git when doing a commit, checkout or merge. See 8.3 Customizing Git - Git Hooks for information about Git hooks. You can find examples of Git hooks in the .git/hooks directory of your project.

提交回复
热议问题