<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Sh on Codrut Constantin Gusoi</title>
    <link>https://www.codrut.pro/tags/sh/</link>
    <description>Recent content in Sh on Codrut Constantin Gusoi</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sun, 08 Jan 2023 13:15:48 +0000</lastBuildDate>
    <atom:link href="https://www.codrut.pro/tags/sh/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Git root empty commit</title>
      <link>https://www.codrut.pro/snippets/git-root-empty-commit/</link>
      <pubDate>Sun, 08 Jan 2023 13:15:48 +0000</pubDate>
      <guid>https://www.codrut.pro/snippets/git-root-empty-commit/</guid>
      <description>&lt;p&gt;The best way to structure yout repository is to have an empty root commit and to&#xA;squash all the other commits periodically onto the second. This reduces the&#xA;repository size making it easier to clone in CI and for your end users.&lt;/p&gt;&#xA;&lt;h2 id=&#34;empty-root-commit&#34;&gt;&#xA;  Empty root commit&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#empty-root-commit&#34;&gt;&#xA;    &lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Create an empty commit:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git commit -m &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Initial commit&amp;#39;&lt;/span&gt; --allow-empty&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Rebase until your root commit:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;git rebase -i --root&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Move the last commit at the very top of your commit list.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
