DEV Community

Discussion on: Co-authoring Git commits

Collapse
 
valscion profile image
Vesa Laakso

Yeah I think you can do a

git commit --amend --trailer 'Co-authored-by: name <person@example.com>'
Enter fullscreen mode Exit fullscreen mode

to get what you want.

And couple that with --reuse-message=HEAD to only add the trailer to the most recent commit and not even trigger an editor to open up:

git commit --amend --trailer 'Co-authored-by: name <person@example.com>' --reuse-message=HEAD
Enter fullscreen mode Exit fullscreen mode