DEV Community

Mohamed Idris
Mohamed Idris

Posted on

How to update your last commit's date?

Initially I tried git commit --amend, it updates the committer date but preserves the author date.

To update the author date to now:

git commit --amend --no-edit --date="now"
Enter fullscreen mode Exit fullscreen mode

Or if you also want to reset the author info (name/email) to your current git config:

git commit --amend --no-edit --reset-author
Enter fullscreen mode Exit fullscreen mode

--reset-author resets both the author date and author identity.
--date="now" only changes the date.

Top comments (0)