
    
        
        
        
                
        
        
        
            
{"version":"https:\/\/jsonfeed.org\/version\/1","title":"mathspp.com feed","home_page_url":"https:\/\/mathspp.com\/blog\/tags\/github","feed_url":"https:\/\/mathspp.com\/blog\/tags\/github.json","description":"Stay up-to-date with the articles on mathematics and programming that get published to mathspp.com.","author":{"name":"Rodrigo Gir\u00e3o Serr\u00e3o"},"items":[{"title":"TIL #119 \u2013 Co-authored commits","date_published":"2025-02-27T17:06:00+01:00","id":"https:\/\/mathspp.com\/blog\/til\/coauthored-commits","url":"https:\/\/mathspp.com\/blog\/til\/coauthored-commits","content_html":"<p>Today I learned how to create co-authored commits on GitHub.<\/p>\n\n<h2 id=\"co-authored-commits\">Co-authored commits<a href=\"#co-authored-commits\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h2>\n<p>On GitHub, co-authored commits allow you to add two or more people as the authors of a commit, effectively marking that commit as a contribution done by multiple users.\nWhen a commit has co-authors, GitHub displays those multiple authors next to the commit, as shown in the image below:<\/p>\n<figure class=\"image-caption\"><img title=\"A commit with two authors.\" alt=\"Screenshot of a commit on GitHub that shows two profile pictures next to the commit, the two authors of the commit, instead of the usual single profile picture.\" src=\"\/user\/pages\/02.blog\/04.til\/119.coauthored-commits\/_commit.webp\"><figcaption class=\"\">A commit with two authors.<\/figcaption><\/figure>\n<h3 id=\"adding-a-co-author\">Adding a co-author<a href=\"#adding-a-co-author\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h3>\n<p>To add co-authors to a commit, the extended commit message should end with a <code>Co-authored-by<\/code> line, that looks like this:<\/p>\n<pre><code class=\"language-txt\">Co-authored-by: NAME &lt;GITHUB EMAIL&gt;<\/code><\/pre>\n<p>If you use the co-author's GitHub email, then the commit will count as a contribution by that author.\nTo find the author's GitHub email, either ask them, or figure the email out on your own.<\/p>\n<h3 id=\"finding-a-github-email\">Finding a GitHub email<a href=\"#finding-a-github-email\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h3>\n<p>To find the email someone uses on GitHub, start by finding a commit they made (for example, open their repositories and open a random commit in one of their repositories).\nThat will give you a link that ends with a long commit hash.<\/p>\n<p>For example, for the commit of the screenshot above, the URL is <a href=\"https:\/\/github.com\/EuroPython\/website\/pull\/1023\/commits\/66fefa8d679f96eef658432e5425c19c13fbb030\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">https:\/\/github.com\/EuroPython\/website\/pull\/1023\/commits\/66fefa8d679f96eef658432e5425c19c13fbb030<\/a>.<\/p>\n<p>Then, add <code>.patch<\/code> to that URL, which will open a very basic page with some info on that commit; most importantly, at the top is the information of the author of the commit.\nAs an example, if you add <code>.patch<\/code> to the URL I showed above, the top of the page will show this information:<\/p>\n<pre><code class=\"language-txt\">From 66fefa8d679f96eef658432e5425c19c13fbb030 Mon Sep 17 00:00:00 2001\nFrom: =?UTF-8?q?Rodrigo=20Gir=C3=A3o=20Serr=C3=A3o?=\n &lt;5621605+rodrigogiraoserrao@users.noreply.github.com&gt;\nDate: Thu, 27 Feb 2025 16:54:26 +0000\nSubject: [PATCH] Add Rust Summit info.<\/code><\/pre>\n<p>If you squint your eyes, you'll find the email I use on GitHub!<\/p>","summary":"Today I learned how to create co-authored commits on GitHub.","date_modified":"2025-10-20T22:34:56+02:00","tags":["github"],"image":"\/user\/pages\/02.blog\/04.til\/119.coauthored-commits\/thumbnail.webp"},{"title":"TIL #050 \u2013 add a suggestion","date_published":"2022-08-25T00:00:00+02:00","id":"https:\/\/mathspp.com\/blog\/til\/add-a-suggestion","url":"https:\/\/mathspp.com\/blog\/til\/add-a-suggestion","content_html":"<p>Today I learned that you can add suggestions directly when reviewing pull requests on GitHub.<\/p>\n\n<p><img alt=\"A blurred GitHub pull request review on the background and the icon of the \u201cadd a suggestion\u201d feature focused in the foreground.\" src=\"\/images\/6\/a\/6\/d\/1\/6a6d1720b724d67b713124ea9a7683b170d589c6-thumbnail.webp\"><\/p>\n<h2 id=\"add-a-suggestion-in-a-github-pull-request-review\">Add a suggestion in a GitHub pull request review<a href=\"#add-a-suggestion-in-a-github-pull-request-review\" class=\"toc-anchor after\" data-anchor-icon=\"#\" aria-label=\"Anchor\"><\/a><\/h2>\n<p>When you are reviewing a pull request on GitHub, you can add comments to one or multiple lines at a time,\nbut you can also leave a direct suggestion that makes it extremely convenient for the other person to make the change that you want to see implemented.<\/p>\n<p>When leaving a comment in a line of code, just look for the icon that looks like a page with a plus sign on top of a minus sign.\nIf you click that icon, GitHub will insert the content of the line(s) of code that is highlighted inside triple backticks.\nThen, just edit that however you like.\nWhatever changes you make there will be shown as a \u201csuggested edit\u201d that the other party can accept with a click of a button.<\/p>\n<p>Below, you can find a little animatied GIF showing how this works:<\/p>\n<ol>\n<li>highlight the lines of code where you want to suggest an edit;<\/li>\n<li>press the \u201cadd a suggestion\u201d icon; and<\/li>\n<li>make your edits directly in the comment.<\/li>\n<\/ol>\n<figure class=\"image-caption\"><img title=\"Animated example of how to add a suggestion on a GitHub pull request review.\" alt=\"Animated example of how to add a suggestion on a GitHub pull request review.\" src=\"\/user\/pages\/02.blog\/04.til\/050.add-a-suggestion\/_add_suggestion_demo.gif?decoding=auto&amp;fetchpriority=auto\"><figcaption class=\"\">Animated example of how to add a suggestion on a GitHub pull request review.<\/figcaption><\/figure>\n<p>That's it for now! <a href=\"\/subscribe\">Stay tuned<\/a> and I'll see you around!<\/p>","summary":"Today I learned that you can add suggestions directly when reviewing pull requests on GitHub.","date_modified":"2025-07-23T16:49:02+02:00","tags":["github"],"image":"\/user\/pages\/02.blog\/04.til\/050.add-a-suggestion\/thumbnail.webp"}]}
