<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/rss/styles.xsl" type="text/xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Today I Learned</title><description>👨‍💻 Daily dev log of things I learned while building software</description><link>https://huam.ing/til/</link><language>en-us</language><siteName>Hua-Ming Huang</siteName><item><title>Using Markdown Image Titles as Captions</title><link>https://huam.ing/using-markdown-image-titles-as-captions/</link><guid isPermaLink="true">https://huam.ing/using-markdown-image-titles-as-captions/</guid><description>Today I learned that Markdown images support a title attribute that creates hover tooltips—and with a rehype plugin, you can transform these titles into captions. Most people are…</description><pubDate>Sat, 31 Jan 2026 00:00:00 GMT</pubDate><content:encoded>


&lt;body&gt;
&lt;p&gt;Today I learned that Markdown images support a title attribute that creates hover tooltips—and with a rehype plugin, you can transform these titles into captions.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Most people are familiar with the standard Markdown image syntax:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;markdown&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:31ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;![&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--0td:underline;--1:#DBEDFF;--1td:underline&quot;&gt;Alt Text&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;](&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--0td:underline;--1:#E1E4E8;--1td:underline&quot;&gt;/path/to/image.jpg&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;![Alt Text](/path/to/image.jpg)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Here, &lt;code&gt;Alt Text&lt;/code&gt; serves as alternative text for accessibility—it appears when images fail to load and helps screen readers describe the image.&lt;/p&gt;
&lt;p&gt;The path can be:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;relative path&lt;/strong&gt; to a local file: &lt;code&gt;./images/photo.jpg&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;An &lt;strong&gt;absolute path&lt;/strong&gt;: &lt;code&gt;/assets/photo.jpg&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;remote URL&lt;/strong&gt;: &lt;code&gt;https://example.com/photo.jpg&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;You can add a &lt;strong&gt;title attribute&lt;/strong&gt; as a second parameter:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;markdown&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:43ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;![&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--0td:underline;--1:#DBEDFF;--1td:underline&quot;&gt;Alt Text&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;](&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--0td:underline;--1:#E1E4E8;--1td:underline&quot;&gt;/path/to/img.jpg&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--0td:underline;--1:#9ECBFF;--1td:underline&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--0td:underline;--1:#DBEDFF;--1td:underline&quot;&gt;image title&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--0td:underline;--1:#9ECBFF;--1td:underline&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;![Alt Text](/path/to/img.jpg &amp;#x22;image title&amp;#x22;)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;This creates a tooltip that appears when users hover over the image. You can also transform these titles into captions.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Markdown doesn’t natively support image captions, which leaves you with some awkward workarounds:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Option 1:&lt;/strong&gt; &lt;a href=&quot;https://stackoverflow.com/questions/19331362/using-an-image-caption-in-markdown-jekyll&quot;&gt;Add text below the image&lt;/a&gt; using HTML tags:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;html&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:52ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;![](image.png)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;sub&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;em&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&gt;This is a caption for the image.&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;em&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;sub&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&quot;&gt;&lt;em&gt;This is a caption for the image.&lt;/em&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Option 2:&lt;/strong&gt; Use raw HTML with &lt;code&gt;&amp;#x3C;figure&gt;&lt;/code&gt; elements:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;html&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:68ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;figure&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:2ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;img&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;image.png&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;alt&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;Example Image&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;width&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;200&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;height&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;200&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:2ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;figcaption&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&gt;This is a caption for the image.&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;figcaption&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;figure&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&quot;&gt;  &lt;img src=&quot;&quot;&gt;  &lt;figcaption&gt;This is a caption for the image.&lt;/figcaption&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Both approaches work, but they break the flow of writing in plain Markdown.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;If you’re writing a blog with a static site generator (like Astro, Next.js, or Gatsby), you can use a &lt;a href=&quot;https://github.com/futuraprime/rehype-figure-title&quot;&gt;rehype plugin&lt;/a&gt; &lt;sup&gt;&lt;a href=&quot;#user-content-fn-1&quot; id=&quot;user-content-fnref-1&quot; data-footnote-ref=&quot;&quot; aria-describedby=&quot;footnote-label&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; that transforms your image titles into captions.&lt;/p&gt;
&lt;p&gt;With this plugin, you write clean Markdown:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;markdown&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:50ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;![&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--0td:underline;--1:#DBEDFF;--1td:underline&quot;&gt;A descriptive alt text&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;](&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--0td:underline;--1:#E1E4E8;--1td:underline&quot;&gt;./img.jpg&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--0td:underline;--1:#9ECBFF;--1td:underline&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--0td:underline;--1:#DBEDFF;--1td:underline&quot;&gt;The caption&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--0td:underline;--1:#9ECBFF;--1td:underline&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;![A descriptive alt text](./img.jpg &amp;#x22;The caption&amp;#x22;)&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;And it becomes:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;html&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:54ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;figure&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;rehype-figure-title&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:2ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;img&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;./img.jpg&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;alt&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;A descriptive alt text&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:2ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;figcaption&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&gt;The caption&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;figcaption&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--0:#1E7734;--1:#85E89D&quot;&gt;figure&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&quot;&gt;  &lt;img src=&quot;&quot;&gt;  &lt;figcaption&gt;The caption&lt;/figcaption&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;section data-footnotes=&quot;&quot; class=&quot;footnotes&quot; style=&quot;font-size: 0.85em; line-height: 1.6;&quot;&gt;
&lt;ol&gt;
&lt;li id=&quot;user-content-fn-1&quot;&gt;
&lt;p&gt;Alternatives: &lt;a href=&quot;https://github.com/y-temp4/rehype-title-figure&quot;&gt;rehype-title-figure&lt;/a&gt; or &lt;a href=&quot;https://github.com/josestg/rehype-figure&quot;&gt;rehype-figure&lt;/a&gt; &lt;a href=&quot;#user-content-fnref-1&quot; data-footnote-backref=&quot;&quot; aria-label=&quot;Back to reference 1&quot; class=&quot;data-footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
&lt;/body&gt;

&lt;hr style=&quot;margin: 2em 0; border: none; border-top: 1px solid #ccc;&quot; /&gt;&lt;p&gt;👉 Share this post: &lt;a href=&quot;https://huam.ing/using-markdown-image-titles-as-captions&quot;&gt;https://huam.ing/using-markdown-image-titles-as-captions&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>Git Pre-Commit Hooks Run Once per Commit, Not per File</title><link>https://huam.ing/git-pre-commit-hooks-run-once-per-commit-not-per-file/</link><guid isPermaLink="true">https://huam.ing/git-pre-commit-hooks-run-once-per-commit-not-per-file/</guid><description>Today I learned that Git’s pre-commit hook is executed/triggered once per commit, not once per file included in the commit. If you want to restrict its behavior to certain files,…</description><pubDate>Mon, 25 Aug 2025 00:00:00 GMT</pubDate><content:encoded>


&lt;body&gt;
&lt;p&gt;Today I learned that Git’s &lt;code&gt;pre-commit&lt;/code&gt; hook is executed/triggered &lt;strong&gt;once per commit, not once per file included in the commit&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;If you want to restrict its behavior to certain files, you need to implement that logic inside your pre-commit script (for example, by checking &lt;a href=&quot;https://git-scm.com/docs/git-diff&quot;&gt;&lt;code&gt;git diff --cached --name-only&lt;/code&gt;&lt;/a&gt; to see which files are staged).&lt;/p&gt;
&lt;p&gt;✼ Example 1: Strip YAML front matter from &lt;code&gt;README.md&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sh&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:80ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;#!/bin/sh&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;diff&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;--cached&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;--name-only&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;grep&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;-q&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&apos;^README.md$&apos;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;then&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:4ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;head&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;-n1&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;README.md&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;grep&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;-q&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&apos;^---$&apos;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;then&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:8ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;sed&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&apos;1,/^---$/d&apos;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;README.md&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;README.md.tmp&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &amp;#x26;&amp;#x26; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;mv&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;README.md.tmp&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;README.md&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:8ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;        &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;README.md&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:4ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;fi&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;fi&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&quot;&gt; README.md.tmp &amp;#x26;&amp;#x26; mv README.md.tmp README.md        git add README.md    fifi&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;✼ Example 2: Run a Python script to update &lt;code&gt;README.md&lt;/code&gt;&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sh&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:62ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;#!/bin/sh&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;diff&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;--cached&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;--name-only&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;grep&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;-q&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&apos;^README.md$&apos;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;then&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:4ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;python3&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;.scripts/update_readme.py&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:4ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;README.md&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;fi&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;#!/bin/shif git diff --cached --name-only | grep -q &amp;#x27;^README.md$&amp;#x27;; then    python3 .scripts/update_readme.py    git add README.mdfi&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;By adding file-based checks, you can avoid unnecessary work and speed up commit performance, &lt;em&gt;especially in large projects&lt;/em&gt;.&lt;/p&gt;
&lt;/body&gt;

&lt;hr style=&quot;margin: 2em 0; border: none; border-top: 1px solid #ccc;&quot; /&gt;&lt;p&gt;👉 Share this post: &lt;a href=&quot;https://huam.ing/git-pre-commit-hooks-run-once-per-commit-not-per-file&quot;&gt;https://huam.ing/git-pre-commit-hooks-run-once-per-commit-not-per-file&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>How to Remove Markdown Frontmatter Programmatically</title><link>https://huam.ing/how-to-remove-markdown-frontmatter-programmatically/</link><guid isPermaLink="true">https://huam.ing/how-to-remove-markdown-frontmatter-programmatically/</guid><description>Today I learned how to strip out YAML frontmatter (--- … ---) from Markdown files using either Python or a shell script. ✼ Python approach ✼ Shell script approach Key takeaway:…</description><pubDate>Sun, 24 Aug 2025 00:00:00 GMT</pubDate><content:encoded>


&lt;body&gt;
&lt;p&gt;Today I learned how to strip out YAML frontmatter (--- … ---) from Markdown files using either Python or a shell script.&lt;/p&gt;
&lt;p&gt;✼ Python approach&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;python&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:49ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;remove_frontmatter&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(md_content):&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:2ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; md_content.startswith(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;---&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;):&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:4ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;# Split the Markdown content into three parts&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:4ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;# parts[0] = &quot;&quot; (before first ---)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:4ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;# parts[1] = YAML frontmatter&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:4ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;# parts[2] = rest of the markdown&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:4ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;parts &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; md_content.split(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;---&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:4ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;(parts) &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:6ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; parts[&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;].lstrip(&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:2ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; md_content&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&quot;&gt; 2:      return parts[2].lstrip(&amp;#x22;\n&amp;#x22;)  return md_content&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;✼ Shell script approach&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;sh&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:66ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;#!/bin/sh&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; [ &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;-f&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; ] &amp;#x26;&amp;#x26; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;head&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;-n1&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;grep&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;-q&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&apos;^---$&apos;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;then&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot; style=&quot;--ecIndent:2ch&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;sed&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&apos;1,/^---$/d&apos;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;.tmp&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &amp;#x26;&amp;#x26; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;mv&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;.tmp&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;fi&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&quot;&gt; &amp;#x22;$file.tmp&amp;#x22; &amp;#x26;&amp;#x26; mv &amp;#x22;$file.tmp&amp;#x22; &amp;#x22;$file&amp;#x22;fi&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Key takeaway:&lt;/strong&gt; Whether in Python or shell, the idea is the same—detect if the file starts with &lt;code&gt;---&lt;/code&gt;, then strip out everything up to the next &lt;code&gt;---&lt;/code&gt;.&lt;/p&gt;
&lt;/body&gt;

&lt;hr style=&quot;margin: 2em 0; border: none; border-top: 1px solid #ccc;&quot; /&gt;&lt;p&gt;👉 Share this post: &lt;a href=&quot;https://huam.ing/how-to-remove-markdown-frontmatter-programmatically&quot;&gt;https://huam.ing/how-to-remove-markdown-frontmatter-programmatically&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>Temporarily Ignore Local Changes to a Tracked File in Git</title><link>https://huam.ing/temporarily-ignore-local-changes-to-a-tracked-file-in-git/</link><guid isPermaLink="true">https://huam.ing/temporarily-ignore-local-changes-to-a-tracked-file-in-git/</guid><description>Today I learned that you can tell Git to temporarily ignore changes to a tracked file using: After this, Git won’t show changes to the file in git status, git add, or git commit.…</description><pubDate>Fri, 22 Aug 2025 00:00:00 GMT</pubDate><content:encoded>


&lt;body&gt;
&lt;p&gt;Today I learned that you can tell Git to temporarily ignore changes to a tracked file using:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:42ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;update-index&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;--assume-unchanged&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&amp;#x3C;file&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&quot;&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;After this, Git won’t show changes to the file in &lt;code&gt;git status&lt;/code&gt;, &lt;code&gt;git add&lt;/code&gt;, or &lt;code&gt;git commit&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To start tracking changes again:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:45ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;update-index&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;--no-assume-unchanged&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&amp;#x3C;file&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&quot;&gt;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h1 id=&quot;caution&quot;&gt;&lt;a href=&quot;#caution&quot;&gt;Caution&lt;/a&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;❗️ If the file is modified in the remote branch and you pull, Git may overwrite your local changes.&lt;/li&gt;
&lt;li&gt;❗️ This is only for temporary local changes; the file remains tracked in the repository.
This is mainly an optimization for large repositories, as Git will skip checking the file for changes, speeding up &lt;code&gt;status&lt;/code&gt; and &lt;code&gt;diff&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;side-notes&quot;&gt;&lt;a href=&quot;#side-notes&quot;&gt;Side Notes&lt;/a&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;This is mainly an optimization for large repositories, as Git will skip checking the file for changes, speeding up &lt;code&gt;status&lt;/code&gt; and &lt;code&gt;diff&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/body&gt;

&lt;hr style=&quot;margin: 2em 0; border: none; border-top: 1px solid #ccc;&quot; /&gt;&lt;p&gt;👉 Share this post: &lt;a href=&quot;https://huam.ing/temporarily-ignore-local-changes-to-a-tracked-file-in-git&quot;&gt;https://huam.ing/temporarily-ignore-local-changes-to-a-tracked-file-in-git&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>How to Minimize Distractions in VS Code</title><link>https://huam.ing/how-to-minimize-distractions-in-vs-code/</link><guid isPermaLink="true">https://huam.ing/how-to-minimize-distractions-in-vs-code/</guid><description>Today I learned how to minimize distractions in VS Code. Activate Zen Mode with Cmd+K Z. Or from the Command Palette → “View: Toggle Zen Mode”. Press Cmd+K Z again to exit Zen…</description><pubDate>Mon, 11 Aug 2025 00:00:00 GMT</pubDate><content:encoded>


&lt;body&gt;
&lt;p&gt;Today I learned how to minimize distractions in VS Code.&lt;/p&gt;
&lt;h1 id=&quot;use-zen-mode&quot;&gt;&lt;a href=&quot;#use-zen-mode&quot;&gt;Use Zen Mode&lt;/a&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Activate Zen Mode with &lt;code&gt;Cmd+K Z&lt;/code&gt;.
&lt;ul&gt;
&lt;li&gt;Or from the Command Palette → “View: Toggle Zen Mode”.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;Cmd+K Z&lt;/code&gt; again to exit Zen Mode.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;hide-ui-elements&quot;&gt;&lt;a href=&quot;#hide-ui-elements&quot;&gt;Hide UI Elements&lt;/a&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Hide the sidebar (&lt;code&gt;Cmd&lt;/code&gt;+&lt;code&gt;B&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Hide the panel (&lt;code&gt;Cmd&lt;/code&gt;+&lt;code&gt;J&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Hide the status bar (&lt;code&gt;Cmd&lt;/code&gt;+&lt;code&gt;Shift&lt;/code&gt;+&lt;code&gt;P&lt;/code&gt; → “View: Toggle Status Bar Visibility”).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Hide the &lt;a href=&quot;https://code.visualstudio.com/docs/getstarted/userinterface#_breadcrumbs&quot;&gt;breadcrumbs&lt;/a&gt; via &lt;code&gt;Cmd&lt;/code&gt;+&lt;code&gt;Shift&lt;/code&gt;+&lt;code&gt;P&lt;/code&gt; → “View: Toggle Breadcrumbs”.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Alternatively, you can add this line to &lt;code&gt;settings.json&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:28ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;breadcrumbs.enabled&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;false&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&amp;#x22;breadcrumbs.enabled&amp;#x22;: false&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Hide the &lt;a href=&quot;https://code.visualstudio.com/docs/getstarted/userinterface#_minimap&quot;&gt;minimap&lt;/a&gt; via &lt;code&gt;Cmd+Shift+P&lt;/code&gt; → “View: Toggle Minimap”.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Alternatively, you can add this line to &lt;code&gt;settings.json&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:31ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;editor.minimap.enabled&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;false&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&amp;#x22;editor.minimap.enabled&amp;#x22;: false&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Hide the scroll bar:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:40ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;editor.scrollbar.horizontal&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;hidden&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;editor.scrollbar.vertical&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;hidden&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&amp;#x22;editor.scrollbar.horizontal&amp;#x22;: &amp;#x22;hidden&amp;#x22;,&amp;#x22;editor.scrollbar.vertical&amp;#x22;: &amp;#x22;hidden&amp;#x22;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Hide the overview ruler:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;json&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:40ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;editor.hideCursorInOverviewRuler&quot;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&amp;#x22;editor.hideCursorInOverviewRuler&amp;#x22;: true&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/body&gt;

&lt;hr style=&quot;margin: 2em 0; border: none; border-top: 1px solid #ccc;&quot; /&gt;&lt;p&gt;👉 Share this post: &lt;a href=&quot;https://huam.ing/how-to-minimize-distractions-in-vs-code&quot;&gt;https://huam.ing/how-to-minimize-distractions-in-vs-code&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>Handling Case-Sensitive File Renames in Git</title><link>https://huam.ing/handling-case-sensitive-file-renames-in-git/</link><guid isPermaLink="true">https://huam.ing/handling-case-sensitive-file-renames-in-git/</guid><description>Today I ran into a frustrating Git issue that I’d never encountered before. I had renamed several image files in my Obsidian vault’s _attachments folder, changing their extensions…</description><pubDate>Fri, 08 Aug 2025 00:00:00 GMT</pubDate><content:encoded>


&lt;body&gt;
&lt;h1 id=&quot;the-problem&quot;&gt;&lt;a href=&quot;#the-problem&quot;&gt;The Problem&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Today I ran into a frustrating Git issue that I’d never encountered before. I had renamed several image files in my Obsidian vault’s &lt;code&gt;_attachments&lt;/code&gt; folder, changing their extensions from uppercase (&lt;code&gt;.PNG&lt;/code&gt;, &lt;code&gt;.JPG&lt;/code&gt;, &lt;code&gt;.WEBP&lt;/code&gt;) to lowercase (&lt;code&gt;.png&lt;/code&gt;, &lt;code&gt;.jpg&lt;/code&gt;, &lt;code&gt;.webp&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;However, when I tried the usual workflow:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:35ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;commit&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;-m&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;Fix file extensions&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;push&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;git add .git commit -m &amp;#x22;Fix file extensions&amp;#x22;git push&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Git didn’t detect any changes, even though I could clearly see the files had different extensions on my filesystem.&lt;/p&gt;
&lt;h1 id=&quot;the-root-cause&quot;&gt;&lt;a href=&quot;#the-root-cause&quot;&gt;The Root Cause&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;The issue stems from macOS having a &lt;strong&gt;case-insensitive filesystem&lt;/strong&gt; while Git is &lt;strong&gt;case-sensitive&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;From the filesystem’s point of view, &lt;code&gt;image.PNG&lt;/code&gt; and &lt;code&gt;image.png&lt;/code&gt; are the same file, but Git sees them as different files.&lt;/p&gt;
&lt;p&gt;This caused a mismatch where Git was still tracking the old uppercase extensions in its index, even though the filesystem only showed the lowercase files.&lt;/p&gt;
&lt;p&gt;As a result, Git doesn’t realize the file has been renamed because the filesystem treats both names as identical.&lt;/p&gt;
&lt;h1 id=&quot;the-solution-git-mv&quot;&gt;&lt;a href=&quot;#the-solution-git-mv&quot;&gt;The Solution: &lt;code&gt;git mv&lt;/code&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;The solution is to use &lt;code&gt;git mv&lt;/code&gt; to explicitly tell Git about the change. The &lt;code&gt;git mv&lt;/code&gt; command renames the file both in your filesystem and Git’s index, so Git can track the rename as a single operation:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:48ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;# Instead of manually renaming files, use git mv&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;mv&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;oldfile.PNG&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;newfile.png&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;mv&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;image.JPG&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;image.jpg&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;mv&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;photo.WEBP&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;photo.webp&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;git mv oldfile.PNG newfile.pnggit mv image.JPG image.jpggit mv photo.WEBP photo.webp&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h1 id=&quot;what-i-did&quot;&gt;&lt;a href=&quot;#what-i-did&quot;&gt;What I Did&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;I had to rename several files that Git was tracking with uppercase extensions:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:106ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;cd&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;/path/to/my/repo&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;# First, find out which files with uppercase extensions Git is tracking&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;ls-files&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;_attachments/&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;grep&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;-E&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;\.(PNG|JPG|WEBP)$&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;# Then rename each one using git mv&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;mv&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;_attachments/2b3a6c702b5b01cf12507cc029630bf3.JPG&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;_attachments/2b3a6c702b5b01cf12507cc029630bf3.jpg&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;mv&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;_attachments/316d587a5c95f54ea7a4f86fbb986d63.PNG&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;_attachments/316d587a5c95f54ea7a4f86fbb986d63.png&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;mv&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;_attachments/33fabea8972383bcb4bbeea50437f690.PNG&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;_attachments/33fabea8972383bcb4bbeea50437f690.png&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;# more attachments...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;# Commit the changes&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;commit&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;-m&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;Rename image file extensions from uppercase to lowercase&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;push&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;cd &amp;#x22;/path/to/my/repo&amp;#x22;git ls-files _attachments/ | grep -E &amp;#x22;\.(PNG|JPG|WEBP)$&amp;#x22;git mv _attachments/2b3a6c702b5b01cf12507cc029630bf3.JPG _attachments/2b3a6c702b5b01cf12507cc029630bf3.jpggit mv _attachments/316d587a5c95f54ea7a4f86fbb986d63.PNG _attachments/316d587a5c95f54ea7a4f86fbb986d63.pnggit mv _attachments/33fabea8972383bcb4bbeea50437f690.PNG _attachments/33fabea8972383bcb4bbeea50437f690.pnggit commit -m &amp;#x22;Rename image file extensions from uppercase to lowercase&amp;#x22;git push&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h1 id=&quot;alternative-solutions&quot;&gt;&lt;a href=&quot;#alternative-solutions&quot;&gt;Alternative Solutions&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Other approaches I could have used (but &lt;code&gt;git mv&lt;/code&gt; is cleanest and simplest):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configure Git to ignore case&lt;/strong&gt; (&lt;em&gt;not recommended&lt;/em&gt;):&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:32ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;config&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;core.ignorecase&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;false&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;git config core.ignorecase false&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Remove and re-add&lt;/strong&gt; (&lt;em&gt;loses history&lt;/em&gt;):&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:16ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;rm&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;file.PNG&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;file.png&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;git rm file.PNGgit add file.png&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;In contrast, when you use &lt;code&gt;git mv&lt;/code&gt;, Git properly records the change as a &lt;strong&gt;rename&lt;/strong&gt;:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:57ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#616972;--1:#99A0A6&quot;&gt;# Git status showed:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;renamed:&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;_attachments/image.PNG&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;--0:#BF3441;--1:#F97583&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;_attachments/image.png&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&quot;&gt; _attachments/image.png&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/body&gt;

&lt;hr style=&quot;margin: 2em 0; border: none; border-top: 1px solid #ccc;&quot; /&gt;&lt;p&gt;👉 Share this post: &lt;a href=&quot;https://huam.ing/handling-case-sensitive-file-renames-in-git&quot;&gt;https://huam.ing/handling-case-sensitive-file-renames-in-git&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>Git Reset</title><link>https://huam.ing/git-reset/</link><guid isPermaLink="true">https://huam.ing/git-reset/</guid><description>Today I learned how to use git reset to undo changes in my repository. git reset is used to undo changes in your Git repository. It allows you to move the current branch to a…</description><pubDate>Thu, 24 Jul 2025 00:00:00 GMT</pubDate><content:encoded>


&lt;body&gt;
&lt;p&gt;Today I learned how to use &lt;code&gt;git reset&lt;/code&gt; to undo changes in my repository.&lt;/p&gt;
&lt;h1 id=&quot;introduction&quot;&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;git reset&lt;/code&gt; is used to &lt;strong&gt;undo&lt;/strong&gt; changes in your Git repository. It allows you to move the current branch to a specific commit and control what happens to your staging area and working directory. &lt;code&gt;git reset&lt;/code&gt; is especially useful when you want to undo commits that have not been pushed to a remote repository.&lt;/p&gt;
&lt;h1 id=&quot;when-to-use&quot;&gt;&lt;a href=&quot;#when-to-use&quot;&gt;When to Use&lt;/a&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;git reset --soft &amp;#x3C;commit&gt;&lt;/code&gt; to move the branch pointer back and keep your changes staged for a new commit.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;git reset --mixed &amp;#x3C;commit&gt;&lt;/code&gt; (or simply &lt;code&gt;git reset &amp;#x3C;commit&gt;&lt;/code&gt;, since &lt;code&gt;--mixed&lt;/code&gt; is the default) to remove files from the staging area but keep changes in your working directory.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;git reset --hard &amp;#x3C;commit&gt;&lt;/code&gt; to completely discard all changes in both the staging area and working directory.
&lt;ul&gt;
&lt;li&gt;⚠️ Dangerous! This will delete all uncommitted changes and is irreversible!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;overview&quot;&gt;&lt;a href=&quot;#overview&quot;&gt;Overview&lt;/a&gt;&lt;/h1&gt;





























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Mode&lt;/th&gt;&lt;th&gt;Affects Commit History&lt;/th&gt;&lt;th&gt;Affects Staging Area&lt;/th&gt;&lt;th&gt;Affects Working Directory&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;--soft&lt;/code&gt;&lt;/td&gt;&lt;td&gt;✅ Yes&lt;/td&gt;&lt;td&gt;❌ No&lt;/td&gt;&lt;td&gt;❌ No&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;--mixed&lt;/code&gt;&lt;/td&gt;&lt;td&gt;✅ Yes&lt;/td&gt;&lt;td&gt;✅ Yes&lt;/td&gt;&lt;td&gt;❌ No&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;--hard&lt;/code&gt;&lt;/td&gt;&lt;td&gt;✅ Yes&lt;/td&gt;&lt;td&gt;✅ Yes&lt;/td&gt;&lt;td&gt;✅ Yes&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h1 id=&quot;summary&quot;&gt;&lt;a href=&quot;#summary&quot;&gt;Summary&lt;/a&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--soft&lt;/code&gt;: Only resets commit history, keeps staging area and working directory unchanged.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--mixed&lt;/code&gt;: Resets commit history and staging area, keeps working directory unchanged.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--hard&lt;/code&gt;: Resets everything, including working directory.&lt;/li&gt;
&lt;/ul&gt;
&lt;/body&gt;

&lt;hr style=&quot;margin: 2em 0; border: none; border-top: 1px solid #ccc;&quot; /&gt;&lt;p&gt;👉 Share this post: &lt;a href=&quot;https://huam.ing/git-reset&quot;&gt;https://huam.ing/git-reset&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>Git Commit Messages from a File</title><link>https://huam.ing/git-commit-messages-from-a-file/</link><guid isPermaLink="true">https://huam.ing/git-commit-messages-from-a-file/</guid><description>Today I learned that there are two main ways to provide a commit message in Git: -m or --message= : This is the most common way, where you provide the message directly on the…</description><pubDate>Sun, 20 Jul 2025 00:00:00 GMT</pubDate><content:encoded>


&lt;body&gt;
&lt;p&gt;Today I learned that there are two main ways to provide a commit message in Git:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;-m &amp;#x3C;msg&gt;&lt;/code&gt; or &lt;code&gt;--message=&amp;#x3C;msg&gt;&lt;/code&gt;: This is the most common way, where you provide the message directly on the command line. You can use multiple &lt;code&gt;-m&lt;/code&gt; options, and their values will be concatenated as separate paragraphs.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-F &amp;#x3C;file&gt;&lt;/code&gt; or &lt;code&gt;--file=&amp;#x3C;file&gt;&lt;/code&gt;: This option allows you to take the commit message from a given file. If you use &lt;code&gt;-&lt;/code&gt; as the filename, the message is read from the standard input. This is particularly useful for multi-line messages as it avoids potential issues with shell character escaping.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;It’s important to note that the &lt;code&gt;-m&lt;/code&gt; and &lt;code&gt;-F&lt;/code&gt; options are mutually exclusive. You can only use one of them for a single commit.&lt;/p&gt;
&lt;p&gt;✱ Example using &lt;code&gt;-F&lt;/code&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a file named &lt;code&gt;commit-message.txt&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;txt&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:81ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8&quot;&gt;feat: Add new login feature&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8&quot;&gt;This commit introduces a new login system with email and password authentication.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8&quot;&gt;It also includes basic validation and error handling.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;feat: Add new login featureThis commit introduces a new login system with email and password authentication.It also includes basic validation and error handling.&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use the file in your commit command:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:32ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;git&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;commit&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;-F&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;commit-message.txt&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;git commit -F commit-message.txt&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/body&gt;

&lt;hr style=&quot;margin: 2em 0; border: none; border-top: 1px solid #ccc;&quot; /&gt;&lt;p&gt;👉 Share this post: &lt;a href=&quot;https://huam.ing/git-commit-messages-from-a-file&quot;&gt;https://huam.ing/git-commit-messages-from-a-file&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>VS Code CLI &amp; URL Schemes</title><link>https://huam.ing/vs-code-cli-and-url-schemes/</link><guid isPermaLink="true">https://huam.ing/vs-code-cli-and-url-schemes/</guid><description>Today I learned that Visual Studio Code has a powerful command-line interface (CLI) that lets you control how you launch the editor through command-line options (switches). Open a…</description><pubDate>Sun, 20 Jul 2025 00:00:00 GMT</pubDate><content:encoded>


&lt;body&gt;
&lt;p&gt;Today I learned that Visual Studio Code has a powerful &lt;a href=&quot;https://code.visualstudio.com/docs/configure/command-line&quot;&gt;command-line interface (CLI)&lt;/a&gt; that lets you control how you launch the editor through command-line options (switches).&lt;/p&gt;
&lt;h1 id=&quot;opening-files-and-folders&quot;&gt;&lt;a href=&quot;#opening-files-and-folders&quot;&gt;Opening Files and Folders&lt;/a&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Open a file&lt;/strong&gt;: &lt;code&gt;code &amp;#x3C;file_path&gt;&lt;/code&gt;. You can list multiple files separated by spaces. If a file doesn’t exist, it will be created. When opening multiple files, VS Code opens them all as tabs in a single window instance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open a folder&lt;/strong&gt;: &lt;code&gt;code &amp;#x3C;folder_path&gt;&lt;/code&gt;. You can specify multiple folders separated by spaces to create a &lt;a href=&quot;https://code.visualstudio.com/docs/editing/workspaces/multi-root-workspaces&quot;&gt;Multi-root Workspace&lt;/a&gt; that includes each folder and allows you to manage multiple project “roots” simultaneously.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;common-cli-options&quot;&gt;&lt;a href=&quot;#common-cli-options&quot;&gt;Common CLI Options&lt;/a&gt;&lt;/h1&gt;
&lt;h2 id=&quot;go-to-file-location-1&quot;&gt;&lt;a href=&quot;#go-to-file-location-1&quot;&gt;Go to File Location &lt;sup&gt;&lt;a href=&quot;#user-content-fn-1&quot; id=&quot;user-content-fnref-1&quot; data-footnote-ref=&quot;&quot; aria-describedby=&quot;footnote-label&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Open a file at a specific line and optional column.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:42ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;code&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;-g,&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;--goto&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;path/to/file:line[:column]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;code -g, --goto path/to/file:line[:column]&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;new-window&quot;&gt;&lt;a href=&quot;#new-window&quot;&gt;New Window&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Open a fresh session of VS Code instead of restoring the previous session.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:46ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;code&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;-n,&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;--new-window&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; [path/to/folder-or-file]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;code -n, --new-window [path/to/folder-or-file]&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;You can also use &lt;code&gt;-r&lt;/code&gt; or &lt;code&gt;--reuse-window&lt;/code&gt; to force opening a file or folder in the last active window.&lt;/p&gt;
&lt;h2 id=&quot;wait-for-close&quot;&gt;&lt;a href=&quot;#wait-for-close&quot;&gt;Wait for Close&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Wait for the opened file to be closed before returning to the command line. This is useful for things like editing a Git commit message.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:28ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;code&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;-w,&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;--wait&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;path/to/file&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;code -w, --wait path/to/file&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;use-a-specific-profile&quot;&gt;&lt;a href=&quot;#use-a-specific-profile&quot;&gt;Use a Specific Profile&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Specify the directory for user data, which is useful for managing separate profiles or running as a different user.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:46ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;code&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;--user-data-dir&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;&quot;/path/to/custom/profile&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;code --user-data-dir &amp;#x22;/path/to/custom/profile&amp;#x22;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;disable-extensions&quot;&gt;&lt;a href=&quot;#disable-extensions&quot;&gt;Disable Extensions&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Open VS Code with all installed extensions temporarily disabled.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:25ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;code&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;--disable-extensions&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;code --disable-extensions&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;verbose-logging&quot;&gt;&lt;a href=&quot;#verbose-logging&quot;&gt;Verbose Logging&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Enables verbose logging, which is helpful for diagnosing issues.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:14ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;code&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;--verbose&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;code --verbose&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;show-help&quot;&gt;&lt;a href=&quot;#show-help&quot;&gt;Show Help&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Displays all available CLI options.&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:11ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;code&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#005CC5;--1:#79B8FF&quot;&gt;--help&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;code --help&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Alternatively, you can view the manual page:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:8ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;man&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#032F62;--1:#9ECBFF&quot;&gt;code&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;man code&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h1 id=&quot;further-reading&quot;&gt;&lt;a href=&quot;#further-reading&quot;&gt;Further Reading&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;For a complete list of options, see the official documentation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://code.visualstudio.com/docs/configure/command-line#_core-cli-options&quot;&gt;Core CLI Options&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://code.visualstudio.com/docs/configure/command-line#_advanced-cli-options&quot;&gt;Advanced CLI Options&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;url-schemes&quot;&gt;&lt;a href=&quot;#url-schemes&quot;&gt;URL Schemes&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;You can also use &lt;code&gt;vscode://&lt;/code&gt; URL schemes to open folders and files.&lt;/p&gt;
&lt;h2 id=&quot;open-a-folder&quot;&gt;&lt;a href=&quot;#open-a-folder&quot;&gt;Open a Folder&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;text&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:36ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8&quot;&gt;vscode://file/{full path to folder}/&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;vscode://file/{full path to folder}/&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;open-a-file&quot;&gt;&lt;a href=&quot;#open-a-file&quot;&gt;Open a File&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;text&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:33ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8&quot;&gt;vscode://file/{full path to file}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;vscode://file/{full path to file}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;open-a-file-to-a-specific-line-and-column&quot;&gt;&lt;a href=&quot;#open-a-file-to-a-specific-line-and-column&quot;&gt;Open a File to a Specific Line and Column&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;text&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:45ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8&quot;&gt;vscode://file/{full path to file}:line:column&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;vscode://file/{full path to file}:line:column&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;section data-footnotes=&quot;&quot; class=&quot;footnotes&quot; style=&quot;font-size: 0.85em; line-height: 1.6;&quot;&gt;
&lt;ol&gt;
&lt;li id=&quot;user-content-fn-1&quot;&gt;
&lt;p&gt;The column number for character position is optional. &lt;a href=&quot;#user-content-fnref-1&quot; data-footnote-backref=&quot;&quot; aria-label=&quot;Back to reference 1&quot; class=&quot;data-footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
&lt;/body&gt;

&lt;hr style=&quot;margin: 2em 0; border: none; border-top: 1px solid #ccc;&quot; /&gt;&lt;p&gt;👉 Share this post: &lt;a href=&quot;https://huam.ing/vs-code-cli-and-url-schemes&quot;&gt;https://huam.ing/vs-code-cli-and-url-schemes&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>How to Write Good Git Commit Messages</title><link>https://huam.ing/how-to-write-good-git-commit-messages/</link><guid isPermaLink="true">https://huam.ing/how-to-write-good-git-commit-messages/</guid><description>Today I learned how to write structure, easy-to-communicate commit messages in Git. A clear, consistent commit message format helps: Quickly understand project history Filter and…</description><pubDate>Sat, 19 Jul 2025 00:00:00 GMT</pubDate><content:encoded>


&lt;body&gt;
&lt;p&gt;Today I learned how to write structure, easy-to-communicate commit messages in Git.&lt;/p&gt;
&lt;h1 id=&quot;why&quot;&gt;&lt;a href=&quot;#why&quot;&gt;Why?&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;A clear, consistent commit message format helps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Quickly understand project history&lt;/li&gt;
&lt;li&gt;Filter and find specific changes (e.g. documentation vs code)&lt;/li&gt;
&lt;li&gt;Generate changelogs automatically (see below for details)&lt;/li&gt;
&lt;/ol&gt;
&lt;h1 id=&quot;recommended-format&quot;&gt;&lt;a href=&quot;#recommended-format&quot;&gt;Recommended Format&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Use the &lt;a href=&quot;https://www.conventionalcommits.org/&quot;&gt;Conventional Commits&lt;/a&gt; standard:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:30ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;&amp;#x3C;type&gt;(&amp;#x3C;scope&gt;&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;): &amp;#x3C;description&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;[optional body]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;[optional footer]&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;&quot;&gt;(&lt;scope&gt;): &lt;description&gt;[optional body][optional footer]&quot;&gt;&lt;div&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Header/Subject&lt;/strong&gt; (&lt;code&gt;type&lt;/code&gt; + &lt;code&gt;scope&lt;/code&gt; + &lt;code&gt;description&lt;/code&gt;) is &lt;em&gt;required&lt;/em&gt;
&lt;ul&gt;
&lt;li&gt;Keep the subject line under 72 characters&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Body&lt;/strong&gt; and &lt;strong&gt;footer&lt;/strong&gt; are &lt;em&gt;optional&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;common-types&quot;&gt;&lt;a href=&quot;#common-types&quot;&gt;Common Types&lt;/a&gt;&lt;/h1&gt;









































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;feat&lt;/code&gt;&lt;/td&gt;&lt;td&gt;New feature&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;fix&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Bug fix&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;docs&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Documentation changes&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;style&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Formatting, whitespace, etc. (no code change)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;refactor&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Code refactor (no bug fix or feature)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;perf&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Performance improvement&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;test&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Adding or updating tests&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;chore&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Routine tasks (build, dependencies, etc.)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h1 id=&quot;writing-good-commit-messages&quot;&gt;&lt;a href=&quot;#writing-good-commit-messages&quot;&gt;Writing Good Commit Messages&lt;/a&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;em&gt;imperative, present tense&lt;/em&gt;: “Fix bug” not “Fixed bug”&lt;/li&gt;
&lt;li&gt;Capitalize the subject line&lt;/li&gt;
&lt;li&gt;No period at the end of the subject&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Example commit messages:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:39ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;feat(auth&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;): add login with Google OAuth&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;fix(api&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;): handle token refresh errors&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#6F42C1;--1:#B392F0&quot;&gt;docs(readme&lt;/span&gt;&lt;span style=&quot;--0:#24292E;--1:#E1E4E8&quot;&gt;): update setup instructions&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;feat(auth): add login with Google OAuthfix(api): handle token refresh errorsdocs(readme): update setup instructions&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h1 id=&quot;helper-tools&quot;&gt;&lt;a href=&quot;#helper-tools&quot;&gt;Helper Tools&lt;/a&gt;&lt;/h1&gt;

























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Tool&lt;/th&gt;&lt;th&gt;What It Does&lt;/th&gt;&lt;th&gt;When It’s Used&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;https://github.com/commitizen/cz-cli&quot;&gt;commitizen&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Interactive CLI that guides you through writing a commit message&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Before&lt;/strong&gt; writing commits&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;https://github.com/conventional-changelog/commitlint&quot;&gt;commitlint&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Lints commit messages to ensure they meet the standard and enforce consistency &lt;sup&gt;&lt;a href=&quot;#user-content-fn-1&quot; id=&quot;user-content-fnref-1&quot; data-footnote-ref=&quot;&quot; aria-describedby=&quot;footnote-label&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;After&lt;/strong&gt; writing commits&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;https://github.com/conventional-changelog/conventional-changelog&quot;&gt;conventional-changelog&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Automatically generates changelogs from commit history&lt;/td&gt;&lt;td&gt;&lt;strong&gt;After&lt;/strong&gt; merging/releasing&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Example workflow:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Write commits using the &lt;a href=&quot;https://www.conventionalcommits.org/&quot;&gt;Conventional Commits&lt;/a&gt; format.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run &lt;code&gt;npx conventional-changelog -i CHANGELOG.md -s&lt;/code&gt; to update your changelog.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This command scans your commit history for Conventional Commits, generates a changelog, writes it to &lt;code&gt;CHANGELOG.md&lt;/code&gt; (&lt;code&gt;-i CHANGELOG.md&lt;/code&gt;), and updates the file in place (&lt;code&gt;-s&lt;/code&gt;). The default preset is Angular, but you can omit &lt;code&gt;-p angular&lt;/code&gt; for most projects.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;💡 &lt;a href=&quot;https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog#usage&quot;&gt;To see all available command line parameters, run: &lt;code&gt;conventional-changelog --help&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optionally, use &lt;a href=&quot;https://github.com/conventional-changelog/standard-version&quot;&gt;&lt;code&gt;standard-version&lt;/code&gt;&lt;/a&gt; or &lt;a href=&quot;https://github.com/release-it/release-it&quot;&gt;&lt;code&gt;release-it&lt;/code&gt;&lt;/a&gt; to bump versions and update changelogs automatically.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;section data-footnotes=&quot;&quot; class=&quot;footnotes&quot; style=&quot;font-size: 0.85em; line-height: 1.6;&quot;&gt;
&lt;ol&gt;
&lt;li id=&quot;user-content-fn-1&quot;&gt;
&lt;p&gt;You can add a Git hook (&lt;a href=&quot;https://git-scm.com/book/ms/v2/Customizing-Git-Git-Hooks&quot;&gt;&lt;code&gt;commit-msg&lt;/code&gt;&lt;/a&gt;) to validate your commit messages: &lt;code&gt;npx commitlint --edit $1&lt;/code&gt; &lt;a href=&quot;#user-content-fnref-1&quot; data-footnote-backref=&quot;&quot; aria-label=&quot;Back to reference 1&quot; class=&quot;data-footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;


&lt;/description&gt;&lt;/scope&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;&lt;/body&gt;&lt;hr style=&quot;margin: 2em 0; border: none; border-top: 1px solid #ccc;&quot; /&gt;&lt;p&gt;👉 Share this post: &lt;a href=&quot;https://huam.ing/how-to-write-good-git-commit-messages&quot;&gt;https://huam.ing/how-to-write-good-git-commit-messages&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>YouTube URL Schemes</title><link>https://huam.ing/youtube-url-schemes/</link><guid isPermaLink="true">https://huam.ing/youtube-url-schemes/</guid><description>Today I learned how to customize YouTube URL schemes to make video sharing more effective: Watch Links Format Regular version: https://www.youtube.com/watch?v= Short version:…</description><pubDate>Thu, 17 Jul 2025 00:00:00 GMT</pubDate><content:encoded>


&lt;body&gt;
&lt;p&gt;Today I learned how to customize YouTube URL schemes to make video sharing more effective:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Watch Links&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Format
&lt;ul&gt;
&lt;li&gt;Regular version: &lt;code&gt;https://www.youtube.com/watch?v=&amp;#x3C;video_id&gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Short version: &lt;code&gt;https://youtu.be/&amp;#x3C;video_id&gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Query parameters
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;t&lt;/code&gt; → Starts the video at a specific timestamp, great for directly jumping to the key moments
&lt;ul&gt;
&lt;li&gt;For example:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;#x26;t=60&lt;/code&gt; starts the video 1 minute in&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;#x26;t=1m30s&lt;/code&gt; starts the video 1 minute and 30 seconds in&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Works for both watch link types:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;https://www.youtube.com/watch?v=cnQLp_DII2o&amp;#x26;t=120&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;https://youtu.be/cnQLp_DII2o?t=120&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The following parameters are unnecessary and can be safely stripped from URLs:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;list&lt;/code&gt; → Shows which &lt;strong&gt;playlist&lt;/strong&gt; the video is from
&lt;ul&gt;
&lt;li&gt;Example: &lt;code&gt;&amp;#x26;list=PLVELbpBnqC0qFKrWNBZupOEV6MX4xt_fM&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ab_channel&lt;/code&gt; → Shows which &lt;strong&gt;channel&lt;/strong&gt; the video is from
&lt;ul&gt;
&lt;li&gt;Example: &lt;code&gt;&amp;#x26;ab_channel=InspiringSquad&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;https://www.youtube.com/embed/&amp;#x3C;video_id&gt;&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;Use this to embed videos on websites &lt;sup&gt;&lt;a href=&quot;#user-content-fn-1&quot; id=&quot;user-content-fnref-1&quot; data-footnote-ref=&quot;&quot; aria-describedby=&quot;footnote-label&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;⭐️ Also, this is helpful for &lt;a href=&quot;https://gist.github.com/huaminghuangtw/be2eaee73f155187ca1ed0570b7268a0&quot;&gt;watching videos without any ads&lt;/a&gt;!&lt;/li&gt;
&lt;li&gt;Example: &lt;code&gt;https://www.youtube.com/watch?v=NcQQVbioeZk&lt;/code&gt; → &lt;code&gt;https://www.youtube.com/embed/NcQQVbioeZk&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Playlist Links&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Format: &lt;code&gt;https://www.youtube.com/playlist?list=&amp;#x3C;playlist_id&gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Channel Links&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Format: &lt;code&gt;https://www.youtube.com/channel/@&amp;#x3C;channel_handle&gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;section data-footnotes=&quot;&quot; class=&quot;footnotes&quot; style=&quot;font-size: 0.85em; line-height: 1.6;&quot;&gt;
&lt;ol&gt;
&lt;li id=&quot;user-content-fn-1&quot;&gt;
&lt;p&gt;&lt;a href=&quot;https://developers.google.com/youtube/player_parameters&quot;&gt;https://developers.google.com/youtube/player_parameters&lt;/a&gt; &lt;a href=&quot;#user-content-fnref-1&quot; data-footnote-backref=&quot;&quot; aria-label=&quot;Back to reference 1&quot; class=&quot;data-footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
&lt;/body&gt;

&lt;hr style=&quot;margin: 2em 0; border: none; border-top: 1px solid #ccc;&quot; /&gt;&lt;p&gt;👉 Share this post: &lt;a href=&quot;https://huam.ing/youtube-url-schemes&quot;&gt;https://huam.ing/youtube-url-schemes&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>GitHub URL Schemes for Viewing, Editing, and Commit History</title><link>https://huam.ing/github-url-schemes-for-viewing-editing-and-commit-history/</link><guid isPermaLink="true">https://huam.ing/github-url-schemes-for-viewing-editing-and-commit-history/</guid><description>Today I learned that GitHub provides several URL schemes for different file operations. For viewing files, use: Example:…</description><pubDate>Wed, 16 Jul 2025 00:00:00 GMT</pubDate><content:encoded>


&lt;body&gt;
&lt;p&gt;Today I learned that GitHub provides several URL schemes for different file operations.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;For &lt;strong&gt;viewing files&lt;/strong&gt;, use: &lt;sup&gt;&lt;a href=&quot;#user-content-fn-1&quot; id=&quot;user-content-fnref-1&quot; data-footnote-ref=&quot;&quot; aria-describedby=&quot;footnote-label&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;text&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:59ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8&quot;&gt;https://github.com/{owner}/{repo}/blob/{branch}/{file_path}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;https://github.com/{owner}/{repo}/blob/{branch}/{file_path}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Example: &lt;a href=&quot;https://github.com/huaminghuangtw/Today-I-Learned/blob/main/posts/github-url-schemes.md&quot;&gt;https://github.com/huaminghuangtw/Today-I-Learned/blob/main/posts/github-url-schemes.md&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To &lt;strong&gt;view raw content&lt;/strong&gt;, use:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;text&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:69ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8&quot;&gt;https://raw.githubusercontent.com/{owner}/{repo}/{branch}/{file_path}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;https://raw.githubusercontent.com/{owner}/{repo}/{branch}/{file_path}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Example: &lt;a href=&quot;https://raw.githubusercontent.com/huaminghuangtw/Today-I-Learned/main/posts/github-url-schemes.md&quot;&gt;https://raw.githubusercontent.com/huaminghuangtw/Today-I-Learned/main/posts/github-url-schemes.md&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When you need to &lt;strong&gt;modify content&lt;/strong&gt;, use:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;text&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:59ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8&quot;&gt;https://github.com/{owner}/{repo}/edit/{branch}/{file_path}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;https://github.com/{owner}/{repo}/edit/{branch}/{file_path}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Example: &lt;a href=&quot;https://github.com/huaminghuangtw/Today-I-Learned/edit/main/posts/github-url-schemes.md&quot;&gt;https://github.com/huaminghuangtw/Today-I-Learned/edit/main/posts/github-url-schemes.md&lt;/a&gt;&lt;/p&gt;
&lt;blockquote class=&quot;callout tip&quot; data-callout=&quot;tip&quot; data-callout-fold=&quot;false&quot;&gt;
&lt;div class=&quot;callout-title&quot;&gt;&lt;div class=&quot;callout-title-inner&quot;&gt;Both view and edit URLs support &lt;code&gt;#Lx&lt;/code&gt; suffix for jumping to specific lines. Edit URLs require login to save changes, while view URLs are public. The key difference is that edit URLs are for proposing changes and editing content, while view URLs are for sharing lines and viewing raw files.&lt;/div&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, to explore &lt;strong&gt;version history&lt;/strong&gt;, use:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;text&quot; class=&quot;wrap&quot; style=&quot;--ecMaxLine:62ch&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#24292e;--1:#e1e4e8&quot;&gt;https://github.com/{owner}/{repo}/commits/{branch}/{file_path}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;copy&quot;&gt;&lt;div aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;button title=&quot;Copy to clipboard&quot; data-copied=&quot;Copied!&quot; data-code=&quot;https://github.com/{owner}/{repo}/commits/{branch}/{file_path}&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Example: &lt;a href=&quot;https://github.com/huaminghuangtw/Today-I-Learned/commits/main/posts/github-url-schemes.md&quot;&gt;https://github.com/huaminghuangtw/Today-I-Learned/commits/main/posts/github-url-schemes.md&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;section data-footnotes=&quot;&quot; class=&quot;footnotes&quot; style=&quot;font-size: 0.85em; line-height: 1.6;&quot;&gt;
&lt;ol&gt;
&lt;li id=&quot;user-content-fn-1&quot;&gt;
&lt;p&gt;With Markdown files (&lt;code&gt;.md&lt;/code&gt;), GitHub automatically adds the &lt;code&gt;plain=1&lt;/code&gt; query parameter when you go to &lt;strong&gt;Code&lt;/strong&gt; view to get a line permalink, because Markdown files are rendered without line numbers in &lt;strong&gt;Preview&lt;/strong&gt; mode. For code files (&lt;code&gt;.js&lt;/code&gt;, &lt;code&gt;.py&lt;/code&gt;, &lt;code&gt;.txt&lt;/code&gt;, etc.), you get syntax highlighting without the &lt;code&gt;plain=1&lt;/code&gt; parameter. &lt;a href=&quot;#user-content-fnref-1&quot; data-footnote-backref=&quot;&quot; aria-label=&quot;Back to reference 1&quot; class=&quot;data-footnote-backref&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
&lt;/body&gt;

&lt;hr style=&quot;margin: 2em 0; border: none; border-top: 1px solid #ccc;&quot; /&gt;&lt;p&gt;👉 Share this post: &lt;a href=&quot;https://huam.ing/github-url-schemes-for-viewing-editing-and-commit-history&quot;&gt;https://huam.ing/github-url-schemes-for-viewing-editing-and-commit-history&lt;/a&gt;&lt;/p&gt;</content:encoded></item><item><title>Git Tags</title><link>https://huam.ing/git-tags/</link><guid isPermaLink="true">https://huam.ing/git-tags/</guid><description>Today I learned that Git tags are like bookmarks pointing to a specific commit. They are commonly used to mark important milestones, such as production releases.…</description><pubDate>Thu, 23 Jan 2025 00:00:00 GMT</pubDate><content:encoded>


&lt;body&gt;
&lt;p&gt;Today I learned that &lt;a href=&quot;https://git-scm.com/docs/git-tag&quot;&gt;Git tags&lt;/a&gt; are like bookmarks pointing to a specific &lt;em&gt;&lt;a href=&quot;https://huam.ing/how-to-write-good-git-commit-messages&quot; id=&quot;bl-how-to-write-good-git-commit-messages&quot;&gt;commit&lt;/a&gt;&lt;/em&gt;. They are commonly used to mark important milestones, such as production releases.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;7e17c6817f2c1952777d0708736f4bb3&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; width=&quot;837&quot; height=&quot;290&quot; src=&quot;https://huam.ing/_astro/7e17c6817f2c1952777d0708736f4bb3.DyO4nO0D_Z12Tq4d.png&quot; srcset=&quot;&quot;&gt;&lt;/p&gt;
&lt;h1 id=&quot;why&quot;&gt;&lt;a href=&quot;#why&quot;&gt;Why?&lt;/a&gt;&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;Mark release snapshots (e.g., &lt;code&gt;v1.0.0&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Track significant changes&lt;/li&gt;
&lt;li&gt;Simplify version management&lt;/li&gt;
&lt;/ol&gt;
&lt;h1 id=&quot;types&quot;&gt;&lt;a href=&quot;#types&quot;&gt;Types&lt;/a&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lightweight (default):&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Just a name for a commit (like a branch that never moves)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Annotated (recommended):&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Checksummed, including metadata (date, tagger, message, optional GPG signature)&lt;/li&gt;
&lt;li&gt;Stored as full objects in the Git database&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;cheat-sheet&quot;&gt;&lt;a href=&quot;#cheat-sheet&quot;&gt;Cheat Sheet&lt;/a&gt;&lt;/h1&gt;





























































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th align=&quot;left&quot;&gt;Command&lt;/th&gt;&lt;th&gt;Note&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;code&gt;git tag [-a] v1.0.0 [&amp;#x3C;commit_id&gt;] [-m &amp;#x3C;msg&gt;]&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Create a tag (annotated with &lt;code&gt;-a&lt;/code&gt; and &lt;code&gt;-m&lt;/code&gt;)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;code&gt;git tag &amp;#x3C;tag_name&gt; HEAD&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Tag the latest commit&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;code&gt;git checkout &amp;#x3C;tag_name&gt;&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Check out a tag&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;code&gt;git tag&lt;/code&gt;&lt;/td&gt;&lt;td&gt;List all tags&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;code&gt;git tag -l &quot;v1.1.*&quot;&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Filter tags by pattern&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;code&gt;git show &amp;#x3C;tag_name&gt;&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Show tag details&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;code&gt;git push origin &amp;#x3C;tag_name&gt;&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Push a tag to remote (tags are not pushed by default)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;code&gt;git push origin --tags&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Push all tags to remote&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;code&gt;git push --follow-tags&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Push only annotated tags&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;code&gt;git tag --delete &amp;#x3C;tag_name&gt;&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Delete a local tag&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;code&gt;git tag | xargs git tag -d&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Delete all local tags&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;code&gt;git push --delete origin &amp;#x3C;tag_name&gt;&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Delete a remote tag&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;left&quot;&gt;&lt;code&gt;git tag | xargs -n 1 git push origin --delete&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Delete all remote tags&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;/body&gt;

&lt;hr style=&quot;margin: 2em 0; border: none; border-top: 1px solid #ccc;&quot; /&gt;&lt;p&gt;👉 Share this post: &lt;a href=&quot;https://huam.ing/git-tags&quot;&gt;https://huam.ing/git-tags&lt;/a&gt;&lt;/p&gt;</content:encoded></item></channel></rss>