Giving Co-author Credit in your GitHub Commits
or: How I Learned to Stop Worrying and Thank my Fellow Developers

We've all been there
You're flipping between tab upon tab upon tab of your browser, looking for an answer that seems to be arcane knowledge lost to time (or Google is taking your literal search as individual keywords and is giving you the opposite of what you need). So what happens then? For most people, your next step is to fire a message to another developer you know. A friend, acquaintance, co-worker, repository contributor; you're looking for answers and you're determined to fix this issue without compromising your creative integrity!
And then BAM! A ping from your device and suddenly you're trying these different solutions until you (hopefully) come across one that works. A sigh of relief comes from your debugging rubber duck as you finish strangling it in Developer Stress™, and you make your way to committing your changes. But as you're writing that commit message, it dawns on you: you should credit your savior for the work they put in to help you fix this! Or maybe you were pair programming with someone and you want to be a considerate developer who lets the world know who all worked on this commit. Either way, this will involve co-authoring your commit.
Please note that the following instructions are written with the prerequisite that all persons of interest are on GitHub.
Gathering Commit Emails
If you're using GitHub Desktop, you have it much easier! Scroll down to "Writing the Commit (GitHub Desktop)"
Start off by collecting the GitHub email addresses of the involved parties. If someone doesn't know off the top of their head, have them type git config --global user.email into their terminal; this will return the commit email address.
If you're unable to get this information from them directly, do not fear! There is a quick way to find the commit email address tied to their GitHub account through a commit from that user:
- Go to the user's GitHub page; we'll use mine for this example

- Go to a repository that the user has made commits in

- Go to the commits for the repo, and click on a commit hash for a commit authored by the user who's commit email you're looking for

- Once you're on the commit page, go to the address bar for your browser and add
.patchto the end of the URL

- You'll find the commit email address here in the highlighted area

Writing the Commit (command line)
- Start by writing your commit message as you normally would, except add two empty lines instead of a closing quotation mark
$ git commit -m "This is an example for my Hashnode article
>
>
- On the next new line, add
Co-authored-by: Example Name <name@exampleemail.com>with each author's information. Give each author their own line. Add a closing quotation mark after the last co-author and hit enter to commit your changes.
$ git commit -m "This is an example for my Hashnode article
>
>
Co-authored-by: Example <name@example.com>
Co-authored-by: Name <example@name.com>"
Writing the Commit (GitHub Desktop)
Thankfully, GitHub has this wonderful GIF that shows how to accomplish this in the GitHub Desktop client!

Source: GitHub Docs (https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors)
Results

Everyone gets their credit, visible for anyone who sees the commit on GitHub.
This is a feature I learned about in college, and it's one I've loved to share with every dev I've met since then!
Now it's your turn: go out and share the contribution love with your friends, acquaintances, co-workers, and repository contributors!