<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>CLI &amp;mdash; pylapp</title>
    <link>https://write.as/pylapp/tag:CLI</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:28:40 +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>
  </channel>
</rss>