31

I want to change my history.

Is it possible to change commit date or make new commit with outdated date?

I think only about system date changing.

tre
  • 845
  • 1
  • 8
  • 11
  • 1
    check this https://stackoverflow.com/questions/3895453/how-do-i-make-a-git-commit-in-the-past – Debabrata Sep 12 '17 at 19:53
  • 1
    **Not a dupe** - this question is about the last commit and the orig is about the retroactive history rewriting. Check also the answers! – peterh Nov 29 '21 at 00:29

1 Answers1

42

Use the --date option when you commit:

git commit --date "Wed Feb 16 14:00 2037 +0100"

Here are the supported date formats:

https://git-scm.com/docs/git-commit#_date_formats

Drew Noakes
  • 300,895
  • 165
  • 679
  • 742