I sometimes want to give props to the users who designed something for me, gave me the idea, created the issue that led to a PR or submitted a PR I closed but ended up adding half of it myself.
How can I add commits that are co-authored on GitHub?
I sometimes want to give props to the users who designed something for me, gave me the idea, created the issue that led to a PR or submitted a PR I closed but ended up adding half of it myself.
How can I add commits that are co-authored on GitHub?
It can be done very easily by using the GitHub Desktop Software:
Commit together with co-authors via GitHub Desktop:
You can also read Creating a commit with multiple authors and Commit together with co-authors
To add co-authors to a commit, just add one or more co-authored-by trailers to the end of the commit message:
Commit message Co-authored-by: Joel Califa <602352+califa@users.noreply.github.com> Co-authored-by: Matt Clark <44023+mclark@users.noreply.github.com>
Include your trailers at the end of your commit message, and have at least one line of white space before them.
Alternatively, there is an open source project, which I contribute to, on GitHub that provides a good way to do it from the command line. This project helps you to set an alias in order to create co-autored commits as follows:
$ git co-commit -m "Commit message" --co "co-author <co-author-email>"
Using this approach, you are able to create co-authored commits without a graphical interface.