Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit the commit date when using git commit --reedit-message?

Tags:

git

git-commit

I recently used git commit --reedit-message=HEAD, to make a new commit while using most of the text from the HEAD. All went well till I observed that after committing, the new commit showed the same date stamp as the previous HEAD.

The log (pretty) looked like this

hash   , auth date , message
86fb360, 2019-11-16, copied commit (committed on 2019-11-21)
6dc9583, 2019-11-16, original commit (committed on 2019-11-16)

The basic log command git log -1also showed the old date.

Why did this happen?

How to make the actual commit date appear on the new commit when using the above command?

like image 933
indojin Avatar asked Apr 25 '26 23:04

indojin


1 Answers

git commit -c @ --reset-author

--reset-author renews the author information including timestamp.

like image 177
phd Avatar answered Apr 27 '26 15:04

phd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!