0

Is there a way to set the file creation date of all committed files to the time of the latest commit?

Brian Johnson
  • 1,629
  • 5
  • 21
  • 26

3 Answers3

1

What you want is can be done with the help of git filter-branch with environment filter. For details look for related issue: How can one change the timestamp of an old commit in Git?

Community
  • 1
  • 1
lisachenko
  • 5,952
  • 3
  • 31
  • 51
0

is there a reason you would like to do this? You should be able to use git commands to see when files were last changed. Relying on the file system could lead to trouble.

The short answer is no.

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141
0

A git pre-commit hook, combined with something like touch would probably work.

This would be local only - git doesn't track the creation dates.

However, I'm struggling to come up with a valid use-case for such a hook.

simont
  • 68,704
  • 18
  • 117
  • 136