Amend co-authors on a commit?
See original GitHub issueShould we make an easy amend feature if a user realises they have committed the wrong or forgotten to add co-authors?
Perhaps something like: git mob rk di --amend - this will replace co-authors in the commit?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
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 <name@email.com>" but change --author to ......
Read more >Creating a commit with multiple authors - GitHub Docs
Creating co-authored commits on the command line · Collect the name and email address for each co-author. · Type your commit message and...
Read more >Rewrite git commit messages and authors - Failure Driven
So we are basically we have: swapped the Author with the Co-author; anonimized the Author email. Note this will change the SHA of...
Read more >How to add multiple authors to a commit in Github - Git Better
Github supports to add multiple authors to a single commit. This feature is helpful when developers do pair programming.
Read more >Improve support for Co-authors - GitKraken User Suggestions
GitHub has support for special annotations in commit messages to give credit to other co-authors who worked on the commit (see ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I started working on a prepare-commit-msg hook written in bash. (My team already relies on a bash prepare-commit-msg hook to insert a ticket number, so we need to combine two hooks into one)
Unlike the sample in node, this implementation only inserts co-authors that are not already present. You can amend a commit with a new set-of co-authors, and it will selectively append the new co-authors after the old co-authors. Tested only on macOS:
(updated 2021-01-14 to fix a lil bug) (updated 2021-05-28 to fix a big bug when using
git commit --verbose, and to skip altogetherwhen rebasing orusingcommit --message) (updated 2021-10-15 to append the current user as a coauthor when they are amending a commit by a different author) (updated 2021-11-09 to undo part of 2021-05-28 update. Do not skip when usingcommit --message)I followed those git commands to amend co-authors. Unfortunately did not work.
The co-authors did not get appended to the end. I had to copy pasta it into the message. Maybe the template does not apply on amend?
I agree we should not have this in git mob but I think it will be worked documented here how to amend a commit to add co-authors. I can see it being an issue which should have an easy to find solution.