0

I use this command to modify a commit date:

 git commit --date="5 day ago" -m "modifying date"

The following is the result of the command above:

 [main 0ab160a] modifying date
 Date: Tue May 9 18:59:29 2023 +0300
 1 file changed, 1 insertion(+)

I then push the commit using this command:

 git push -f origin main

Result of pushing the commit:

 Enumerating objects: 5, done.
 Counting objects: 100% (5/5), done.
 Writing objects: 100% (3/3), 267 bytes | 89.00 KiB/s, done.
 Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
 To https://github.com/testings1404/Testings.git
 1282afa..0ab160a  main -> main

I checked the commit through github website and it doesn't show the new date 9th of may. It shows the it was committed few minutes ago:

enter image description here

Azeem
  • 11,148
  • 4
  • 27
  • 40
kaka
  • 597
  • 3
  • 5
  • 16

1 Answers1

0

I think it has something to do with the fact that there are committer and author dates in git commits, as e.g. these answers point out:

Chr L
  • 89
  • 4