<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>commits &amp;mdash; pylapp</title>
    <link>https://write.as/pylapp/tag:commits</link>
    <description>Software crafter, digital punker - &lt;a href=&#34;https://pylapersonne.info&#34; title=&#34;Personal web site&#34;&gt;pylapersonne.info&lt;/a&gt;</description>
    <pubDate>Sun, 23 Aug 2026 04:30:21 +0000</pubDate>
    <item>
      <title>My Git cheatsheet</title>
      <link>https://write.as/pylapp/my-git-cheatsheet?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[h1My Git cheatsheet/h1&#xA;&#xA;i🇺🇸 - Last update: Monday, January 12th 2026/i&#xA;&#xA;biKeywords: #Git, #commits, #GitHub, #GPG, #CLI/i/b&#xA;&#xA;h2A bit of context/h2&#xA;&#xA;Sometimes I need to get back some commands I used in my terminal so as to work on my Git repositories of GitHub / GitLab projects. But I can have often some doubts about them, so I decided to list here some useful commands as a cheatsheet or a simple reminder to keep and share. I will try to keep it updated. There are nice resources in the bottom of this document!&#xA;&#xA;h3Applying some common Git configurations/h3&#xA;&#xA;Use also the em--global/em option if you want to apply this configuration everwyhere.&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-1.png&#34; title=&#34;Define Git local configuration&#34; alt=&#34;Apply &#39;git config&#39; command with parameters &#39;user.name&#39;, &#39;user.email&#39; and &#39;user.signingKey&#39; and after the value&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h3Showing GPG keys to get ID to use for commits /h3&#xA;&#xA;Useful to remember the ID of the GPG key to use to sign commits. More details in a href=&#34;https://write.as/pylapp/au-fait-pensez-vous-a-signer-vos-commits&#34; title=&#34;Other publication in french of commit signing&#34;this other publication (in french)/a.&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-2.png&#34; title=&#34;List GPG keys&#34; alt=&#34;Apply GPG command &#39;gpg --list-keys --keyid-format=short&#39;&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h3Verify GPG signature of commits/h3&#xA;&#xA;Keep in mind the software forges like a href=&#34;https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification&#34; title=&#34;GitHub documentation about commit verifications&#34;GitHub/a and a href=&#34;https://docs.gitlab.com/ee/user/project/repository/signed_commits/&#34; title=&#34;GitLab documentation about signed commits&#34;GitLab/a provide also some verification process for commits.&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-3.png&#34; title=&#34;Verify GPG signature of commit&#34; alt=&#34;&#39;git verify-commit&#39; or &#39;git log --show-signature&#39;&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h3Verify GPG signature of artifacts/h3&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-13.png&#34; title=&#34;Verify GPG signature of artifacts&#34; alt=&#34;&#39;gpg --verify&#39;&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h3Verify assets or release integrity (GH)/h3&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-14.png&#34; title=&#34;Verify assets of release integrity with GitHub CLI client signature of artifacts&#34; alt=&#34;&#39;gh release verify&#39; or &#39;gh release verify-asset&#39;&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h3Display contributors of a commit/h3&#xA;&#xA;You can also filter to get other metadata in commits, a href=&#34;https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst#n525&#34; title=&#34;Keywords fields in commit messages for patches&#34;find here for example some ideas./a&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-4.png&#34; title=&#34;Display commit authors and committers&#34; alt=&#34;Use options of command &#39;git show&#39;&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h3Create branch from another and switch/h3&#xA;&#xA;That&#39;s not the only command of course, but I like this one.&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-5.png&#34; title=&#34;Switch to new branch&#34; alt=&#34;Apply command &#39;git checkout -b new-branch source-branch&#39;&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h3Get rid of the last N commits/h3&#xA;&#xA;You can use of course other things instead of emHEAD~N/em.&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-6.png&#34; title=&#34;Get rid of the N last commits and push&#34; alt=&#34;Apply command &#39;git reset --hard HEAD~N&#39; then push with option &#39;--force-with-lease&#39;&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h3Reword, reorder or squash last N commits with interactive rebease/h3&#xA;&#xA;You can use of course other things instead of emHEAD~N/em. Beware of emfixup/em and emsquash/em, not the same uses with the commit messages.&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-7.png&#34; title=&#34;Interactive rebase&#34; alt=&#34;git rebase -i HEAD~N&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h3Create a Git patch/h3&#xA;&#xA;Allows to generate a Git patch from a diff to apply or send it later.&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-10.png&#34; title=&#34;Use the git format-patch to build a patch file&#34; alt=&#34;Use commands &#39;git diff&#39; or &#39;git format-patch&#39; then &#39;git apply&#39;&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h3Keeping somewhere changes temporary/h3&#xA;&#xA;Useful for drafts or temporary changes you don&#39;t want to version.&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-9.png&#34; title=&#34;Use the stash stack&#34; alt=&#34;Use variants of command &#39;git stash&#39; with actions &#39;push&#39;, &#39;pop&#39;, &#39;apply&#39;&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h3Find someone to blame (maybe you!)/h3&#xA;&#xA;The aim is to display who modified lines of files.&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-11.png&#34; title=&#34;Use the &#39;git blame&#39; command&#34; alt=&#34;Use command &#39;git blame&#39; with -p and -e options&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h3Clean the repository/h3&#xA;&#xA;Clean the project, get rid of files, but beware, you may loose things!&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-12.png&#34; title=&#34;For available types of commandes depending to what you want to do&#34; alt=&#34;Use &#39;clean -fd&#39; to get rid of unnsaved files and directories, &#39;reset --hard&#39; to go back to last commit, &#39;rm --cached&#39; to remove modifications but keeping file and &#39;checkout&#39; to make a file be reset to last commit&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h3Work on a fork and submit/h3&#xA;&#xA;The workflow is simple: fork, create local develop branch with your dev stuff, make meaningful commits, then cherry-picks from this branch to a virgin one so as to submit a nice and simple pull request.&#xA;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-8.png&#34; title=&#34;Fork, sync, commit, cherry-pick and push&#34; alt=&#34;Add upstream remote, checkout dev branch and rebase, make cherry-pick from working branch to pull request branch&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;h2Resources/h2&#xA;&#xA;You have also some online resources like a href=&#34;https://git-cheat-sheet.readthedocs.io/en/latest/&#34; title=&#34;Some cheat sheet notes for Git&#34;git-cheat-sheet.readthedocs.io/a.&#xA;&#xA;But, maybe most important, you can refer also to this amazing comic of a href=&#34;https://jvns.ca/&#34; title=&#34;Website of Julia Evans&#34;Julia Evans/a, available a href=&#34;https://programming.dev/post/19807634&#34; title=&#34;Lemmy (programming.dev instance) publication of the hyperlink&#34;online/a and also a href=&#34;https://wizardzines.com/zines/git/&#34; title=&#34;Wizardzines page about Julia Evans book about Git&#34;buy her book/a.&#xA;Her comic bellow is licensed under a href=&#34;https://store.wizardzines.com/pages/faq&#34; title=&#34;FAQ explaining the license&#34;CC-BY-NC-SA 4.0/a.&#xA;&#xA;a href=&#34;https://wizardzines.com/comics/git-cheat-sheet/&#34; title=&#34;Click on the image to go to the online original version&#34;&#xA;img src=&#34;https://pylapersonne.info/data/cdn/blog/26/julian-evans-wizardzine.png&#34; title=&#34;Fork, sync, commit, cherry-pick and push&#34; alt=&#34;Add upstream remote, checkout dev branch and rebase, make cherry-pick from cworking branch to pull request branch&#34; class=&#34;centerImage toBigImage&#34;/&#xA;/a&#xA;[Code samples rendered with a href=&#34;https://carbon.now.sh&#34; title=&#34;Online tool for preview&#34;carbon.now.sh/a] !-- Material / bash config without X/Y offset --&#xA;&#xA;--&#xA;iPosted on Friday, September 27th 2024/i&#xA;--&#xA;&#xA;Did you enjoy reading this blog?&#xD;&#xA;a href=&#34;https://pylapersonne.info/buymeacoffee&#34; title=&#34;Profile of pylapp in buymeacoffee.com&#34; aria-label=&#34;Go to buymeacoffee.com&#34;Give me a beer 🍺/a or use a href=&#34;https://pylapersonne.info/donate&#34; title=&#34;Page for support in pylapersonne.info web site&#34; aria-label=&#34;Use another way to support on pylapersonne.info website&#34;something else/a ❤️‍🔥&#xD;&#xA;Licensed under a href=&#34;https://creativecommons.org/licenses/by-sa/4.0/&#34;CC-BY-SA 4.0/a.&#xD;&#xA;Opinions are my own.&#xD;&#xA;To contact me, feel free to choose a href=&#34;https://pylapersonne.info/menu&#34; title=&#34;Menu page of my web site with social networks and contact mediums&#34;the most suitable medium for you/a, or for example a href=&#34;https://framapiaf.org/@pylapp&#34; title=&#34;Mastodon profile&#34;Mastodon/a.]]&gt;</description>
      <content:encoded><![CDATA[<h1>My Git cheatsheet</h1>

<p><i>🇺🇸 – Last update: Monday, January 12th 2026</i></p>

<p><b><i>Keywords: <a href="https://write.as/pylapp/tag:Git" class="hashtag"><span>#</span><span class="p-category">Git</span></a>, <a href="https://write.as/pylapp/tag:commits" class="hashtag"><span>#</span><span class="p-category">commits</span></a>, <a href="https://write.as/pylapp/tag:GitHub" class="hashtag"><span>#</span><span class="p-category">GitHub</span></a>, <a href="https://write.as/pylapp/tag:GPG" class="hashtag"><span>#</span><span class="p-category">GPG</span></a>, <a href="https://write.as/pylapp/tag:CLI" class="hashtag"><span>#</span><span class="p-category">CLI</span></a></i></b></p>

<h2>A bit of context</h2>

<p>Sometimes I need to get back some commands I used in my terminal so as to work on my Git repositories of GitHub / GitLab projects. But I can have often some doubts about them, so I decided to list here some useful commands as a cheatsheet or a simple reminder to keep and share. I will try to keep it updated. There are nice resources in the bottom of this document!</p>

<h3>Applying some common Git configurations</h3>

<p>Use also the <em>—global</em> option if you want to apply this configuration everwyhere.</p>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-1.png" title="Define Git local configuration" alt="Apply &#39;git config&#39; command with parameters &#39;user.name&#39;, &#39;user.email&#39; and &#39;user.signingKey&#39; and after the value" class="centerImage toBigImage"/></p>

<h3>Showing GPG keys to get ID to use for commits </h3>

<p>Useful to remember the ID of the GPG key to use to sign commits. More details in <a href="https://write.as/pylapp/au-fait-pensez-vous-a-signer-vos-commits" title="Other publication in french of commit signing">this other publication (in french)</a>.</p>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-2.png" title="List GPG keys" alt="Apply GPG command &#39;gpg --list-keys --keyid-format=short&#39;" class="centerImage toBigImage"/></p>

<h3>Verify GPG signature of commits</h3>

<p>Keep in mind the software forges like <a href="https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification" title="GitHub documentation about commit verifications">GitHub</a> and <a href="https://docs.gitlab.com/ee/user/project/repository/signed_commits/" title="GitLab documentation about signed commits">GitLab</a> provide also some verification process for commits.</p>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-3.png" title="Verify GPG signature of commit" alt="&#39;git verify-commit&#39; or &#39;git log --show-signature&#39;" class="centerImage toBigImage"/></p>

<h3>Verify GPG signature of artifacts</h3>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-13.png" title="Verify GPG signature of artifacts" alt="&#39;gpg --verify&#39;" class="centerImage toBigImage"/></p>

<h3>Verify assets or release integrity (GH)</h3>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-14.png" title="Verify assets of release integrity with GitHub CLI client signature of artifacts" alt="&#39;gh release verify&#39; or &#39;gh release verify-asset&#39;" class="centerImage toBigImage"/></p>

<h3>Display contributors of a commit</h3>

<p>You can also filter to get other metadata in commits, <a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst#n525" title="Keywords fields in commit messages for patches">find here for example some ideas.</a></p>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-4.png" title="Display commit authors and committers" alt="Use options of command &#39;git show&#39;" class="centerImage toBigImage"/></p>

<h3>Create branch from another and switch</h3>

<p>That&#39;s not the only command of course, but I like this one.</p>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-5.png" title="Switch to new branch" alt="Apply command &#39;git checkout -b new-branch source-branch&#39;" class="centerImage toBigImage"/></p>

<h3>Get rid of the last N commits</h3>

<p>You can use of course other things instead of <em>HEAD~N</em>.</p>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-6.png" title="Get rid of the N last commits and push" alt="Apply command &#39;git reset --hard HEAD~N&#39; then push with option &#39;--force-with-lease&#39;" class="centerImage toBigImage"/></p>

<h3>Reword, reorder or squash last N commits with interactive rebease</h3>

<p>You can use of course other things instead of <em>HEAD~N</em>. Beware of <em>fixup</em> and <em>squash</em>, not the same uses with the commit messages.</p>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-7.png" title="Interactive rebase" alt="git rebase -i HEAD~N" class="centerImage toBigImage"/></p>

<h3>Create a Git patch</h3>

<p>Allows to generate a Git patch from a diff to apply or send it later.</p>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-10.png" title="Use the git format-patch to build a patch file" alt="Use commands &#39;git diff&#39; or &#39;git format-patch&#39; then &#39;git apply&#39;" class="centerImage toBigImage"/></p>

<h3>Keeping somewhere changes temporary</h3>

<p>Useful for drafts or temporary changes you don&#39;t want to version.</p>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-9.png" title="Use the stash stack" alt="Use variants of command &#39;git stash&#39; with actions &#39;push&#39;, &#39;pop&#39;, &#39;apply&#39;" class="centerImage toBigImage"/></p>

<h3>Find someone to blame (maybe you!)</h3>

<p>The aim is to display who modified lines of files.</p>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-11.png" title="Use the &#39;git blame&#39; command" alt="Use command &#39;git blame&#39; with -p and -e options" class="centerImage toBigImage"/></p>

<h3>Clean the repository</h3>

<p>Clean the project, get rid of files, but beware, you may loose things!</p>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-12.png" title="For available types of commandes depending to what you want to do" alt="Use &#39;clean -fd&#39; to get rid of unnsaved files and directories, &#39;reset --hard&#39; to go back to last commit, &#39;rm --cached&#39; to remove modifications but keeping file and &#39;checkout&#39; to make a file be reset to last commit" class="centerImage toBigImage"/></p>

<h3>Work on a fork and submit</h3>

<p>The workflow is simple: fork, create local develop branch with your dev stuff, make meaningful commits, then cherry-picks from this branch to a virgin one so as to submit a nice and simple pull request.</p>

<p><img src="https://pylapersonne.info/data/cdn/blog/26/git-cheatsheet-8.png" title="Fork, sync, commit, cherry-pick and push" alt="Add upstream remote, checkout dev branch and rebase, make cherry-pick from working branch to pull request branch" class="centerImage toBigImage"/></p>

<h2>Resources</h2>

<p>You have also some online resources like <a href="https://git-cheat-sheet.readthedocs.io/en/latest/" title="Some cheat sheet notes for Git">git-cheat-sheet.readthedocs.io</a>.</p>

<p>But, maybe most important, you can refer also to this amazing comic of <a href="https://jvns.ca/" title="Website of Julia Evans">Julia Evans</a>, available <a href="https://programming.dev/post/19807634" title="Lemmy (programming.dev instance) publication of the hyperlink">online</a> and also <a href="https://wizardzines.com/zines/git/" title="Wizardzines page about Julia Evans book about Git">buy her book</a>.
Her comic bellow is licensed under <a href="https://store.wizardzines.com/pages/faq" title="FAQ explaining the license">CC-BY-NC-SA 4.0</a>.</p>

<p><a href="https://wizardzines.com/comics/git-cheat-sheet/" title="Click on the image to go to the online original version">
<img src="https://pylapersonne.info/data/cdn/blog/26/julian-evans-wizardzine.png" title="Fork, sync, commit, cherry-pick and push" alt="Add upstream remote, checkout dev branch and rebase, make cherry-pick from cworking branch to pull request branch" class="centerImage toBigImage"/>
</a>
[Code samples rendered with <a href="https://carbon.now.sh" title="Online tool for preview">carbon.now.sh</a>] </p>

<p>—
<i>Posted on Friday, September 27th 2024</i>
—</p>

<p>Did you enjoy reading this blog?
<a href="https://pylapersonne.info/buymeacoffee" title="Profile of pylapp in buymeacoffee.com">Give me a beer 🍺</a> or use <a href="https://pylapersonne.info/donate" title="Page for support in pylapersonne.info web site">something else</a> ❤️‍🔥
Licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA 4.0</a>.
Opinions are my own.
To contact me, feel free to choose <a href="https://pylapersonne.info/menu" title="Menu page of my web site with social networks and contact mediums">the most suitable medium for you</a>, or for example <a href="https://framapiaf.org/@pylapp" title="Mastodon profile">Mastodon</a>.</p>
]]></content:encoded>
      <guid>https://write.as/pylapp/my-git-cheatsheet</guid>
      <pubDate>Fri, 27 Sep 2024 09:46:31 +0000</pubDate>
    </item>
    <item>
      <title>Au fait, pensez-vous à signer vos commits ?</title>
      <link>https://write.as/pylapp/au-fait-pensez-vous-a-signer-vos-commits?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[h1Au fait, pensez-vous à signer vos commits ?/h1&#xA;&#xA;i🇫🇷 – mercredi 8 juin 2022/i&#xA;&#xA;biMots clés : #Git, #commits, #GPG, #signature, #cryptographie/i/b&#xA;&#xA;Au jour d&#39;aujourd&#39;hui il est indéniable que le code source a une valeur concrète, tant pour ce qui est de la propriété intellectuelle et du patrimoine logiciel qui en découle que pour les sommes investies pour son écriture. En 2009, a href=&#34;https://www.silicon.fr/la-valeur-des-logiciels-open-source-estimee-a-400-milliards-de-dollars-35259.html&#34; title=&#34;Aller à l&#39;article de silicon.fr&#34; alt=&#34;Aller à l&#39;article de silicon.fr&#34;un article de silicon.fr/a est paru et évoquait le fait que la valeur des logiciels open source est estimée à 400 milliards de dollars américains, explosant les quelques 25 milliards de dollars américains pour l&#39;écosystème emLinux/em !&#xA; &#xA;Le fait est qu&#39;il faut être capable de définir, et surtout certifier, qui est l&#39;auteur des commits pour savoir à qui appartient la contribution induite. Lorsque des entreprises travaillent avec des filiales ou des prestataires, ou quand du code source est cédé à une fondation ou un organisme tiers, voire même si les projets open source sont critiques, certifier l&#39;origine du commit est rassurant.&#xA;&#xA;Certes, on pourrait se contenter de regarder l&#39;identité de l&#39;auteur, avec par exemple la bonne vieille commande igit log/i, permettant de ressortir l&#39;historique emGit/em et d&#39;obtenir des détails sur les derniers commits.&#xA;&#xA;img style=&#34;border: 1px black solid;&#34; src=&#34;https://pylapersonne.info/data/cdn/blog/22/author.png&#34; title=&#34;Affichage d&#39;un commit Git&#34; alt=&#34;Affichage d&#39;un commit Git. On distingue notamment une section \&#34;Author\&#34; de valeur \&#34;Pierre-Yves Lapersonne\&#34; avec pour adresse email \&#34;dev@pylapersonne.info\&#34;. Il y a aussi un champ \&#34;Signed-off-by:\&#34; avec les même valeurs&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;Sauf que le champ iAuthor/i d&#39;un icommit/i est définit par deux éléments : les champs iuser.name/i et iuser.email/i de la configuration emGit/em (locale ou globale). Or, ces champs peuvent être définis par n&#39;importe qui, avec n&#39;importe quelle valeur, sans vraiment de contrôle naïf et natif sur ça. Ils ne sont donc pas à considérer comme fiables.&#xA;&#xA;On pourrait aussi regarder du côté du iDeveloper Certificate of Origin (DCO)/i, avec notamment l&#39;option i-s/i dans la commande emGit/em de icommit/i. Or le iDCO/i n&#39;est pas dédié à cette question, mais plutôt au fait que l&#39;on confirme avoir les autorisations qui vont bien pour faire ce icommit/i, apporter cette contribution, a href=&#34;https://en.wikipedia.org/wiki/DeveloperCertificateof_Origin#:~:text=The%20Developer%20Certificate%20of%20Origin,Contributor%20License%20Agreement%20(CLA).&#34; title=&#34;Aller à la page Wikipedia sur le DCO&#34; alt=&#34;Aller à la page Wikipedia sur le DCO&#34;dans le respect des licences par exemple/a. C&#39;est intéressant, mais pas adapté.&#xA;&#xA;On peut par contre considérer la signature des icommits/i via... une clé emGPG/em (option i-S/i).&#xA;&#xA;L&#39;idée est simple finalement : on créé une clé emGPG/em, on la dépose dans son compte sur sa forge logicielle (emGitHub/em ou emGitLab/em par exemple), et on définit dans le dépôt en local la clé à utiliser (iuser.signingkey/i). Ainsi, on peut plus fortement confirmer que le icommit/i est bien signé par une personne via sa clé emGPG/em avec la même adresse e-mail entre celle du commit et celle de la clé. C&#39;est d&#39;ailleurs très pratique car via sa forge on peut facilement voir que le commit est vérifié (iellipse bleue/i), avec une clé emGPG/em d&#39;identifiant donné (irectangle vert/i), et d&#39;ailleurs signé avec le DCO (irectangle rouge/i). Bon le hic c&#39;est qu&#39;il faut être capable d&#39;avoir une autorité permettant de vérifier les clés, ou alors de placer une confiance aveugle envers la forge logicielle concernée dont peut-être les administrateurs seraient peu scrupuleux et capables d&#39;altérer les clés publiques enregistrées. À creuser en tout cas.&#xA;&#xA;img style=&#34;border: 1px black solid;&#34; src=&#34;https://pylapersonne.info/data/cdn/blog/22/verified.png&#34; title=&#34;Extrait de l&#39;interface web de GitHub indiquant que le commit concerné est bien cryptographiquement vérifié&#34; alt=&#34;Extrait de l&#39;interface web de GitHub indiquant que le commit concerné est bien cryptographiquement vérifié&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;img style=&#34;border: 1px black solid;&#34; src=&#34;https://pylapersonne.info/data/cdn/blog/22/show.png&#34; title=&#34;Affichage d&#39;un commit Git avec détails sur la clé GPG utilisée&#34; alt=&#34;Affichage d&#39;un commit Git. On distingue entre autres une rubrique concernant la clé GPG utilisée avec la cryptographie utilisée et l&#39;empreinte de la clé ainsi que l&#39;adresse email utilisée&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;Ce faisant, il est même possible de vérifier ia posteriori/i la signature d&#39;un commit via la commande igit show [commit] --show-signature/i, ou plus appropriée la commande igit verify-commit [commit]/i qui renvoie le strict nécessaire en terme d&#39;informations.&#xA;&#xA;img style=&#34;border: 1px black solid;&#34; src=&#34;https://pylapersonne.info/data/cdn/blog/22/verify.png&#34; title=&#34;Message indiquant que le commit concerné est bien cryptographiquement vérifié&#34; alt=&#34;Message indiquant que le commit concerné est bien cryptographiquement vérifié&#34; class=&#34;centerImage toBigImage&#34;/&#xA;&#xA;Remarque, ce serait intéressant d&#39;avoir des ihooks/i vérifiant au moment du icommit/i s&#39;il est bien signé. Dans des projets critiques ou sensibles, on saura ainsi s&#39;il n&#39;y a pas un contributeur tiers qui aurait commis des icommits/i sans autorisation. Ce n&#39;est pas suffisant, mais ça aide.&#xA;&#xA;On peut ainsi voir que pour le commit donné, il y a bien eu une signature avec une clé emGPG/em de type emEDDSA/em avec l&#39;identifiant indiqué (dont on retrouve une partie à la fin), et une note indiquant que c&#39;est bien la bonne adresse email qui est utilisée.&#xA;&#xA;Bref, pensez à signer vos commits. C&#39;est rigolo et ça fait classe.&#xA;&#xA;Pour en savoir davantage, je vous conseille a href=&#34;https://daily-dev-tips.com/posts/how-to-verify-your-commits-on-github/&#34; title=&#34;Aller à l&#39;article de daily-dev-tips.com sur la vérification cryptographique des commits&#34; alt=&#34;Aller à l&#39;article de daily-dev-tips.com sur la vérification cryptographique des commits&#34;cet article assez simple/a et aussi cette page de la documentation emGitHub/em à propos d&#39;une nouvelle fonctionnalité chez eux : a href=&#34;https://docs.github.com/en/authentication/managing-commit-signature-verification/displaying-verification-statuses-for-all-of-your-commits&#34; title=&#34;Aller à la page GitHub sur le mode vigilant&#34; alt=&#34;Aller à la page GitHub sur le mode vigilant&#34;&#34;le mode vigilant&#34;/a.&#xA;&#xA;--&#xA;iDernière mise à jour : lundi 3 octobre 2022/i&#xA;iPrécédemment sur a href=&#34;https://paper.wf/pylapp&#34; title=&#34;Profil sur l&#39;instance paper.wf, plus disponible, compte supprimé&#34; alt=&#34;Profil sur l&#39;instance paper.wf, plus disponible, compte supprimé&#34;paper.wf/a&#xA;--&#xA;&#xA;Did you enjoy reading this blog?&#xD;&#xA;a href=&#34;https://pylapersonne.info/buymeacoffee&#34; title=&#34;Profile of pylapp in buymeacoffee.com&#34; aria-label=&#34;Go to buymeacoffee.com&#34;Give me a beer 🍺/a or use a href=&#34;https://pylapersonne.info/donate&#34; title=&#34;Page for support in pylapersonne.info web site&#34; aria-label=&#34;Use another way to support on pylapersonne.info website&#34;something else/a ❤️‍🔥&#xD;&#xA;Licensed under a href=&#34;https://creativecommons.org/licenses/by-sa/4.0/&#34;CC-BY-SA 4.0/a.&#xD;&#xA;Opinions are my own.&#xD;&#xA;To contact me, feel free to choose a href=&#34;https://pylapersonne.info/menu&#34; title=&#34;Menu page of my web site with social networks and contact mediums&#34;the most suitable medium for you/a, or for example a href=&#34;https://framapiaf.org/@pylapp&#34; title=&#34;Mastodon profile&#34;Mastodon/a.]]&gt;</description>
      <content:encoded><![CDATA[<h1>Au fait, pensez-vous à signer vos commits ?</h1>

<p><i>🇫🇷 – mercredi 8 juin 2022</i></p>

<p><b><i>Mots clés : <a href="https://write.as/pylapp/tag:Git" class="hashtag"><span>#</span><span class="p-category">Git</span></a>, <a href="https://write.as/pylapp/tag:commits" class="hashtag"><span>#</span><span class="p-category">commits</span></a>, <a href="https://write.as/pylapp/tag:GPG" class="hashtag"><span>#</span><span class="p-category">GPG</span></a>, <a href="https://write.as/pylapp/tag:signature" class="hashtag"><span>#</span><span class="p-category">signature</span></a>, <a href="https://write.as/pylapp/tag:cryptographie" class="hashtag"><span>#</span><span class="p-category">cryptographie</span></a></i></b></p>

<p>Au jour d&#39;aujourd&#39;hui il est indéniable que le code source a une valeur concrète, tant pour ce qui est de la propriété intellectuelle et du patrimoine logiciel qui en découle que pour les sommes investies pour son écriture. En 2009, <a href="https://www.silicon.fr/la-valeur-des-logiciels-open-source-estimee-a-400-milliards-de-dollars-35259.html" title="Aller à l&#39;article de silicon.fr">un article de silicon.fr</a> est paru et évoquait le fait que la valeur des logiciels open source est estimée à 400 milliards de dollars américains, explosant les quelques 25 milliards de dollars américains pour l&#39;écosystème <em>Linux</em> !</p>

<p>Le fait est qu&#39;il faut être capable de définir, et surtout certifier, qui est l&#39;auteur des commits pour savoir à qui appartient la contribution induite. Lorsque des entreprises travaillent avec des filiales ou des prestataires, ou quand du code source est cédé à une fondation ou un organisme tiers, voire même si les projets open source sont critiques, certifier l&#39;origine du commit est rassurant.</p>

<p>Certes, on pourrait se contenter de regarder l&#39;identité de l&#39;auteur, avec par exemple la bonne vieille commande <i>git log</i>, permettant de ressortir l&#39;historique <em>Git</em> et d&#39;obtenir des détails sur les derniers commits.</p>

<p><img style="border: 1px black solid;" src="https://pylapersonne.info/data/cdn/blog/22/author.png" title="Affichage d&#39;un commit Git" alt="Affichage d&#39;un commit Git. On distingue notamment une section \" class="centerImage toBigImage"/></p>

<p>Sauf que le champ <i>Author</i> d&#39;un <i>commit</i> est définit par deux éléments : les champs <i>user.name</i> et <i>user.email</i> de la configuration <em>Git</em> (locale ou globale). Or, ces champs peuvent être définis par n&#39;importe qui, avec n&#39;importe quelle valeur, sans vraiment de contrôle naïf et natif sur ça. Ils ne sont donc pas à considérer comme fiables.</p>

<p>On pourrait aussi regarder du côté du <i>Developer Certificate of Origin (DCO)</i>, avec notamment l&#39;option <i>-s</i> dans la commande <em>Git</em> de <i>commit</i>. Or le <i>DCO</i> n&#39;est pas dédié à cette question, mais plutôt au fait que l&#39;on confirme avoir les autorisations qui vont bien pour faire ce <i>commit</i>, apporter cette contribution, <a href="https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin#:~:text=The%20Developer%20Certificate%20of%20Origin,Contributor%20License%20Agreement%20(CLA)." title="Aller à la page Wikipedia sur le DCO">dans le respect des licences par exemple</a>. C&#39;est intéressant, mais pas adapté.</p>

<p>On peut par contre considérer la signature des <i>commits</i> via... une clé <em>GPG</em> (option <i>-S</i>).</p>

<p>L&#39;idée est simple finalement : on créé une clé <em>GPG</em>, on la dépose dans son compte sur sa forge logicielle (<em>GitHub</em> ou <em>GitLab</em> par exemple), et on définit dans le dépôt en local la clé à utiliser (<i>user.signingkey</i>). Ainsi, on peut plus fortement confirmer que le <i>commit</i> est bien signé par une personne via sa clé <em>GPG</em> avec la même adresse e-mail entre celle du commit et celle de la clé. C&#39;est d&#39;ailleurs très pratique car via sa forge on peut facilement voir que le commit est vérifié (<i>ellipse bleue</i>), avec une clé <em>GPG</em> d&#39;identifiant donné (<i>rectangle vert</i>), et d&#39;ailleurs signé avec le DCO (<i>rectangle rouge</i>). Bon le hic c&#39;est qu&#39;il faut être capable d&#39;avoir une autorité permettant de vérifier les clés, ou alors de placer une confiance aveugle envers la forge logicielle concernée dont peut-être les administrateurs seraient peu scrupuleux et capables d&#39;altérer les clés publiques enregistrées. À creuser en tout cas.</p>

<p><img style="border: 1px black solid;" src="https://pylapersonne.info/data/cdn/blog/22/verified.png" title="Extrait de l&#39;interface web de GitHub indiquant que le commit concerné est bien cryptographiquement vérifié" alt="Extrait de l&#39;interface web de GitHub indiquant que le commit concerné est bien cryptographiquement vérifié" class="centerImage toBigImage"/></p>

<p><img style="border: 1px black solid;" src="https://pylapersonne.info/data/cdn/blog/22/show.png" title="Affichage d&#39;un commit Git avec détails sur la clé GPG utilisée" alt="Affichage d&#39;un commit Git. On distingue entre autres une rubrique concernant la clé GPG utilisée avec la cryptographie utilisée et l&#39;empreinte de la clé ainsi que l&#39;adresse email utilisée" class="centerImage toBigImage"/></p>

<p>Ce faisant, il est même possible de vérifier <i>a posteriori</i> la signature d&#39;un commit via la commande <i>git show [commit] —show-signature</i>, ou plus appropriée la commande <i>git verify-commit [commit]</i> qui renvoie le strict nécessaire en terme d&#39;informations.</p>

<p><img style="border: 1px black solid;" src="https://pylapersonne.info/data/cdn/blog/22/verify.png" title="Message indiquant que le commit concerné est bien cryptographiquement vérifié" alt="Message indiquant que le commit concerné est bien cryptographiquement vérifié" class="centerImage toBigImage"/></p>

<p>Remarque, ce serait intéressant d&#39;avoir des <i>hooks</i> vérifiant au moment du <i>commit</i> s&#39;il est bien signé. Dans des projets critiques ou sensibles, on saura ainsi s&#39;il n&#39;y a pas un contributeur tiers qui aurait commis des <i>commits</i> sans autorisation. Ce n&#39;est pas suffisant, mais ça aide.</p>

<p>On peut ainsi voir que pour le commit donné, il y a bien eu une signature avec une clé <em>GPG</em> de type <em>EDDSA</em> avec l&#39;identifiant indiqué (dont on retrouve une partie à la fin), et une note indiquant que c&#39;est bien la bonne adresse email qui est utilisée.</p>

<p>Bref, pensez à signer vos commits. C&#39;est rigolo et ça fait classe.</p>

<p>Pour en savoir davantage, je vous conseille <a href="https://daily-dev-tips.com/posts/how-to-verify-your-commits-on-github/" title="Aller à l&#39;article de daily-dev-tips.com sur la vérification cryptographique des commits">cet article assez simple</a> et aussi cette page de la documentation <em>GitHub</em> à propos d&#39;une nouvelle fonctionnalité chez eux : <a href="https://docs.github.com/en/authentication/managing-commit-signature-verification/displaying-verification-statuses-for-all-of-your-commits" title="Aller à la page GitHub sur le mode vigilant">“le mode vigilant”</a>.</p>

<p>—
<i>Dernière mise à jour : lundi 3 octobre 2022</i>
<i>Précédemment sur <a href="https://paper.wf/pylapp" title="Profil sur l&#39;instance paper.wf, plus disponible, compte supprimé">paper.wf</a>
—</p>

<p>Did you enjoy reading this blog?
<a href="https://pylapersonne.info/buymeacoffee" title="Profile of pylapp in buymeacoffee.com">Give me a beer 🍺</a> or use <a href="https://pylapersonne.info/donate" title="Page for support in pylapersonne.info web site">something else</a> ❤️‍🔥
Licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA 4.0</a>.
Opinions are my own.
To contact me, feel free to choose <a href="https://pylapersonne.info/menu" title="Menu page of my web site with social networks and contact mediums">the most suitable medium for you</a>, or for example <a href="https://framapiaf.org/@pylapp" title="Mastodon profile">Mastodon</a>.</p>
]]></content:encoded>
      <guid>https://write.as/pylapp/au-fait-pensez-vous-a-signer-vos-commits</guid>
      <pubDate>Wed, 17 May 2023 11:35:39 +0000</pubDate>
    </item>
  </channel>
</rss>