Search code examples
gitgithubgit-commitgit-amend

How do I add a co-author to latest pushed git commit?


I need to add a co-author to my last commit and I tried using git commit --amend --author="name <[email protected]>" but change --author to --co-authored-by. I thought this would be an easily google-able fix but everything is only for authors and not co-authors.


Solution

  • "Co-author" is not a git concept. It is a convention in commit messages used by some services, including GitHub. So, the solution is to edit the actual commit message with git commit --amend and add a line to the end:

    Co-Authored-By: Name <[email protected]>