<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Max's Blog]]></title><description><![CDATA[Max's Blog]]></description><link>https://www.maxw.blog</link><generator>RSS for Node</generator><lastBuildDate>Fri, 01 May 2026 01:58:04 GMT</lastBuildDate><atom:link href="https://www.maxw.blog/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Giving Co-author Credit in your GitHub Commits]]></title><description><![CDATA[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...]]></description><link>https://www.maxw.blog/giving-co-author-credit-in-your-github-commits</link><guid isPermaLink="true">https://www.maxw.blog/giving-co-author-credit-in-your-github-commits</guid><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><dc:creator><![CDATA[Max Walters]]></dc:creator><pubDate>Sun, 13 Mar 2022 21:53:15 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/kwzWjTnDPLk/upload/v1647204032180/crOrEw-XsD.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-weve-all-been-there">We've all been there</h1>
<p>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!</p>
<p>And then <strong>BAM!</strong> 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 <em>all</em> worked on this commit. Either way, this will involve <strong>co-authoring your commit</strong>.</p>
<p><em>Please note that the following instructions are written with the prerequisite that all persons of interest are on GitHub.</em></p>
<h1 id="heading-gathering-commit-emails">Gathering Commit Emails</h1>
<p><strong><em>If you're using GitHub Desktop, you have it much easier! Scroll down to "Writing the Commit (GitHub Desktop)"</em></strong></p>
<p>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 <code>git config --global user.email</code> into their terminal; this will return the commit email address.</p>
<p>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:</p>
<ul>
<li>Go to the user's GitHub page; we'll use <a target="_blank" href="https://github.com/warpaltarpers">mine</a> for this example</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647201447224/ScZkJ8DCK.png" alt="ghp.png" /></p>
<ul>
<li>Go to a repository that the user has made commits in</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647201906432/ysrHLlgBi.png" alt="ghr.png" /></p>
<ul>
<li>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</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647202101143/eZUZ_ZKOW.png" alt="ghc.png" /></p>
<ul>
<li>Once you're on the commit page, go to the address bar for your browser and add <code>.patch</code> to the end of the URL</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647202251319/QqXHcDwot.png" alt="ghcs.png" /></p>
<ul>
<li>You'll find the commit email address here in the highlighted area</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647202353531/PoA7alOs5.png" alt="p.png" /></p>
<h1 id="heading-writing-the-commit-command-line">Writing the Commit (command line)</h1>
<ul>
<li>Start by writing your commit message as you normally would, <strong>except</strong> add two empty lines instead of a closing quotation mark</li>
</ul>
<pre><code>$ git <span class="hljs-keyword">commit</span> -m "This is an example for my Hashnode article
&gt;
&gt;
</code></pre><ul>
<li>On the <em>next</em> new line, add <code>Co-authored-by: Example Name &lt;name@exampleemail.com&gt;</code> 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.</li>
</ul>
<pre><code>$ git commit -<span class="hljs-keyword">m</span> <span class="hljs-string">"This is an example for my Hashnode article
&gt;
&gt;
Co-authored-by: Example &lt;name@example.com&gt;
Co-authored-by: Name &lt;example@name.com&gt;"</span>
</code></pre><h1 id="heading-writing-the-commit-github-desktop">Writing the Commit (GitHub Desktop)</h1>
<p>Thankfully, GitHub has this wonderful GIF that shows how to accomplish this in the GitHub Desktop client!</p>
<p><img src="https://docs.github.com/assets/cb-1355315/images/help/desktop/co-authors-demo-hq.gif" alt="co-authors-demo-hq.gif" /></p>
<blockquote>
<p>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)</p>
</blockquote>
<h1 id="heading-results">Results</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1647203052272/mqaWy0bG2.png" alt="co-author.png" /></p>
<p>Everyone gets their credit, visible for anyone who sees the commit on GitHub.</p>
<p>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!</p>
<p>Now it's your turn: go out and share the contribution love with your friends, acquaintances, co-workers, and repository contributors!</p>
]]></content:encoded></item></channel></rss>