0

As per this post it is suggested to use below method to change the timestamp (GIT_AUTHOR_DATE and GIT_COMMITTER_DATE) of a specific commit: It works but it changes all the commit ids. Is there any way to change the timestamp without changing commit ids?

  • 1
    This is why you never rely on commit IDs in the long term. Use tags to refer to previous changes. – Schwern Aug 04 '22 at 20:37
  • 1
    Near duplicates: https://stackoverflow.com/q/37186727/3216427 https://stackoverflow.com/q/18251852/3216427 I was hoping to find a more canonical duplicate for this question, which I'm sure has been asked more times, but I couldn't find one. – joanis Aug 04 '22 at 20:57
  • 1
    You cannot. That metadata is part of the information that is used to create the revision and then, from its content, the hash is generated.... so you change the date, it _necessarily_ will change the revision ID.... say, it's not changed... it's a completely different object altogether. – eftshift0 Aug 05 '22 at 08:19

1 Answers1

5

No, the author and committer timestamps are two of the elements used to generate the commit hash.

mipadi
  • 398,885
  • 90
  • 523
  • 479