Skip to main content

Command Palette

Search for a command to run...

How to change a commit timestamp

Updated
1 min read
How to change a commit timestamp
E

Hey, y’all 🖖🏽 I am a passionate self-taught developer, open-source advocate, and tech enthusiast with a hands-on approach to problem-solving and an unending thirst for knowledge. Anything and everything classified as technology fascinate me.

You may need to change the datetime of a commit in some situations. For example, some countries use daylight saving time period and because of it, some commits can have the wrong timestamp.

git commit --amend --date "Thu Feb 15 22:37:31 2018 +0300"

You should commit and then you can change the timestamp later.

References

  1. https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---dateltdategt