Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy commit metadata (author, date) from another commit

Tags:

git

git-commit

I'm sure there is a way to do this in git, but my searches are coming up empty. Is there an easy way to get the message, commit author, commit date and other info from one commit and amend the second commit with this data, without copying the actual commit contents?

like image 936
Mario Carneiro Avatar asked Sep 02 '18 16:09

Mario Carneiro


Video Answer


1 Answers

git commit --amend --reuse-message=<source commit hash>
like image 74
dwardu Avatar answered Oct 24 '22 20:10

dwardu