ckclark’s Blog–reset-author flag in git commitCommentsRecent PostsCategoriesTagsSocial

當使用git commit -c/--reedit-messagegit commit -C/--reuse-message的場合
有時候只是想拿上個 commit message 當 template 來用(like git commit -c HEAD)
不過最近發現 author date 也會沿用這個指定的commit的
查了一下在manual裡面有提到

-C <commit>
--reuse-message=<commit>
Take an existing commit object, and reuse the log message and the authorship information (including the timestamp) when creating the commit.

解決方法就是加上--reset-author就搞定了

--reset-author
When used with -C/-c/--amend options, or when committing after a a conflicting cherry-pick,
declare that the authorship of the resulting commit now belongs to the committer.
This also renews the author timestamp.