<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Git on Derek's Blog</title><link>https://blog.hnghd.com/tags/git/</link><description>Recent content in Git on Derek's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 21 Apr 2026 17:24:51 +0000</lastBuildDate><atom:link href="https://blog.hnghd.com/tags/git/index.xml" rel="self" type="application/rss+xml"/><item><title>GitHub Release Guide</title><link>https://blog.hnghd.com/notes/github-release-guide/</link><pubDate>Sun, 27 Jul 2025 00:00:00 +0000</pubDate><guid>https://blog.hnghd.com/notes/github-release-guide/</guid><description>&lt;p&gt;How to create a GitHub Release — both via the web UI and via CLI.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="prerequisites"&gt;Prerequisites&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A GitHub repository&lt;/li&gt;
&lt;li&gt;Git installed: &lt;a href="https://git-scm.com/"&gt;https://git-scm.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;For CLI: GitHub CLI (&lt;code&gt;gh&lt;/code&gt;): &lt;a href="https://cli.github.com/"&gt;https://cli.github.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Login with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh auth login
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;h2 id="ui-method-web"&gt;UI Method (Web)&lt;/h2&gt;
&lt;h3 id="step-1-commit-and-push"&gt;Step 1: Commit and push&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git add .
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git commit -m &lt;span class="s2"&gt;&amp;#34;feat: add new feature&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git push origin main
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="step-2-create-and-push-a-tag"&gt;Step 2: Create and push a tag&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git tag v1.2.3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git push origin v1.2.3
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="step-3-create-release-on-github"&gt;Step 3: Create Release on GitHub&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Go to your repo → find &lt;code&gt;Releases&lt;/code&gt; in the sidebar&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Create a new release&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Fill in Tag version, Release title, Description&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Publish release&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id="cli-method"&gt;CLI Method&lt;/h2&gt;
&lt;h3 id="step-12-same-as-above-commit-tag-push"&gt;Step 1–2: Same as above (commit, tag, push)&lt;/h3&gt;
&lt;h3 id="step-3-create-release-via-cli"&gt;Step 3: Create release via CLI&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gh release create v1.2.3 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --title &lt;span class="s2"&gt;&amp;#34;v1.2.3&amp;#34;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --notes &lt;span class="s2"&gt;&amp;#34;### Bug Fixes\n- Fix JSON special character handling (#2481)&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Or use a Markdown file:&lt;/p&gt;</description><content:encoded><![CDATA[<p>How to create a GitHub Release — both via the web UI and via CLI.</p>
<hr>
<h2 id="prerequisites">Prerequisites</h2>
<ul>
<li>A GitHub repository</li>
<li>Git installed: <a href="https://git-scm.com/">https://git-scm.com/</a></li>
<li>For CLI: GitHub CLI (<code>gh</code>): <a href="https://cli.github.com/">https://cli.github.com/</a></li>
</ul>
<p>Login with:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">gh auth login
</span></span></code></pre></div><hr>
<h2 id="ui-method-web">UI Method (Web)</h2>
<h3 id="step-1-commit-and-push">Step 1: Commit and push</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git add .
</span></span><span class="line"><span class="cl">git commit -m <span class="s2">&#34;feat: add new feature&#34;</span>
</span></span><span class="line"><span class="cl">git push origin main
</span></span></code></pre></div><h3 id="step-2-create-and-push-a-tag">Step 2: Create and push a tag</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git tag v1.2.3
</span></span><span class="line"><span class="cl">git push origin v1.2.3
</span></span></code></pre></div><h3 id="step-3-create-release-on-github">Step 3: Create Release on GitHub</h3>
<ol>
<li>Go to your repo → find <code>Releases</code> in the sidebar</li>
<li>Click <code>Create a new release</code></li>
<li>Fill in Tag version, Release title, Description</li>
<li>Click <code>Publish release</code></li>
</ol>
<hr>
<h2 id="cli-method">CLI Method</h2>
<h3 id="step-12-same-as-above-commit-tag-push">Step 1–2: Same as above (commit, tag, push)</h3>
<h3 id="step-3-create-release-via-cli">Step 3: Create release via CLI</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">gh release create v1.2.3 <span class="se">\
</span></span></span><span class="line"><span class="cl">  --title <span class="s2">&#34;v1.2.3&#34;</span> <span class="se">\
</span></span></span><span class="line"><span class="cl">  --notes <span class="s2">&#34;### Bug Fixes\n- Fix JSON special character handling (#2481)&#34;</span>
</span></span></code></pre></div><p>Or use a Markdown file:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">gh release create v1.2.3 <span class="se">\
</span></span></span><span class="line"><span class="cl">  --title <span class="s2">&#34;v1.2.3&#34;</span> <span class="se">\
</span></span></span><span class="line"><span class="cl">  --notes-file CHANGELOG.md
</span></span></code></pre></div><hr>
<h2 id="useful-commands">Useful Commands</h2>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Delete a release</span>
</span></span><span class="line"><span class="cl">gh release delete v1.2.3
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Delete a remote tag</span>
</span></span><span class="line"><span class="cl">git tag -d v1.2.3
</span></span><span class="line"><span class="cl">git push origin :refs/tags/v1.2.3
</span></span></code></pre></div>]]></content:encoded></item><item><title>Git &amp; Jekyll Workflow Notes</title><link>https://blog.hnghd.com/notes/git-jekyll-workflow-notes/</link><pubDate>Sat, 19 Jul 2025 00:00:00 +0000</pubDate><guid>https://blog.hnghd.com/notes/git-jekyll-workflow-notes/</guid><description>&lt;h2 id="git-workflow"&gt;Git Workflow&lt;/h2&gt;
&lt;h3 id="stage-all-changes-at-once"&gt;Stage all changes at once&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git add .
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;.&lt;/code&gt; means add all modified or new files.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id="correct-commit-message-format-to-avoid-commitlint-errors"&gt;Correct commit message format (to avoid commitlint errors)&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git commit -m &lt;span class="s2"&gt;&amp;#34;feat: update about page and fix broken icons&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;feat&lt;/td&gt;
&lt;td&gt;New feature&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fix&lt;/td&gt;
&lt;td&gt;Bug fix&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;docs&lt;/td&gt;
&lt;td&gt;Documentation changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;style&lt;/td&gt;
&lt;td&gt;Formatting (no logic change)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;refactor&lt;/td&gt;
&lt;td&gt;Code refactor (not a bug fix)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;chore&lt;/td&gt;
&lt;td&gt;Misc tasks (no functional impact)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;blockquote&gt;
&lt;p&gt;Commit message must follow the format &lt;code&gt;type: message&lt;/code&gt;, otherwise &lt;code&gt;commitlint&lt;/code&gt; or &lt;code&gt;husky&lt;/code&gt; will block the commit.&lt;/p&gt;</description><content:encoded><![CDATA[<h2 id="git-workflow">Git Workflow</h2>
<h3 id="stage-all-changes-at-once">Stage all changes at once</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git add .
</span></span></code></pre></div><p><code>.</code> means add all modified or new files.</p>
<hr>
<h3 id="correct-commit-message-format-to-avoid-commitlint-errors">Correct commit message format (to avoid commitlint errors)</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git commit -m <span class="s2">&#34;feat: update about page and fix broken icons&#34;</span>
</span></span></code></pre></div><table>
  <thead>
      <tr>
          <th>Type</th>
          <th>Purpose</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>feat</td>
          <td>New feature</td>
      </tr>
      <tr>
          <td>fix</td>
          <td>Bug fix</td>
      </tr>
      <tr>
          <td>docs</td>
          <td>Documentation changes</td>
      </tr>
      <tr>
          <td>style</td>
          <td>Formatting (no logic change)</td>
      </tr>
      <tr>
          <td>refactor</td>
          <td>Code refactor (not a bug fix)</td>
      </tr>
      <tr>
          <td>chore</td>
          <td>Misc tasks (no functional impact)</td>
      </tr>
  </tbody>
</table>
<blockquote>
<p>Commit message must follow the format <code>type: message</code>, otherwise <code>commitlint</code> or <code>husky</code> will block the commit.</p>
</blockquote>
<hr>
<h3 id="push-to-github">Push to GitHub</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git push origin main
</span></span></code></pre></div><hr>
<h2 id="errors-i-encountered">Errors I Encountered</h2>
<h3 id="yaml-syntax-error">YAML syntax error</h3>
<pre tabindex="0"><code>could not find expected &#39;:&#39; while scanning a simple key
</code></pre><p>Fix: Open the <code>.yml</code> file in VS Code, check indentation, colons, and quotes — especially in locale files like <code>en.yml</code>.</p>
<hr>
<h2 id="local-jekyll-testing">Local Jekyll Testing</h2>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">bundle <span class="nb">exec</span> jekyll serve
</span></span></code></pre></div><p>Preview at <code>http://localhost:4000</code>. YAML errors will prevent startup — fix and restart.</p>
<hr>
<h2 id="quick-tips">Quick Tips</h2>
<ul>
<li>Use <code>git status</code> before committing to see what changed</li>
<li>If stuck on commit format, <code>--no-verify</code> ignores checks (not recommended long-term)</li>
</ul>
]]></content:encoded></item></channel></rss>