<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Git - Tag - Vindrin</title><link>https://vindrin.top/tags/git/</link><description>Git - Tag - Vindrin</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>vindrin@outlook.com (Vindrin)</managingEditor><webMaster>vindrin@outlook.com (Vindrin)</webMaster><lastBuildDate>Tue, 10 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://vindrin.top/tags/git/" rel="self" type="application/rss+xml"/><item><title>Understanding Git Rebase vs Merge</title><link>https://vindrin.top/posts/git-rebase-vs-merge/</link><pubDate>Tue, 10 Mar 2026 00:00:00 +0000</pubDate><author>vindrin@outlook.com (Vindrin)</author><guid>https://vindrin.top/posts/git-rebase-vs-merge/</guid><description><![CDATA[<h1 id="understanding-git-rebase-vs-merge">Understanding Git Rebase vs Merge</h1>
<p>This is the question that confuses every developer at some point. Let&rsquo;s settle it.</p>
<h2 id="merge">Merge</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git checkout main
</span></span><span class="line"><span class="cl">git merge feature-branch</span></span></code></pre></div></div>
<p>Creates a <strong>merge commit</strong>. History shows exactly what happened: two branches joined at a point. Safe for shared branches.</p>
<h2 id="rebase">Rebase</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git checkout feature-branch
</span></span><span class="line"><span class="cl">git rebase main</span></span></code></pre></div></div>
<p>Rewrites your commits on top of <code>main</code>. History looks <strong>linear</strong> — as if you started the feature after main was updated.</p>]]></description></item><item><title>Git Quick Reference</title><link>https://vindrin.top/docs/git-quick-reference/</link><pubDate>Mon, 05 Jan 2026 00:00:00 +0000</pubDate><author>vindrin@outlook.com (Vindrin)</author><guid>https://vindrin.top/docs/git-quick-reference/</guid><description><![CDATA[<h1 id="git-quick-reference">Git Quick Reference</h1>
<p>The commands I reach for every day.</p>
<h2 id="repository-setup">Repository setup</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git init                        <span class="c1"># new repo</span>
</span></span><span class="line"><span class="cl">git clone &lt;url&gt;                 <span class="c1"># clone remote</span>
</span></span><span class="line"><span class="cl">git clone --recurse-submodules  <span class="c1"># with submodules</span></span></span></code></pre></div></div>
<h2 id="staging--committing">Staging &amp; committing</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git status                      <span class="c1"># what&#39;s changed</span>
</span></span><span class="line"><span class="cl">git add .                       <span class="c1"># stage all</span>
</span></span><span class="line"><span class="cl">git add -p                      <span class="c1"># interactive staging</span>
</span></span><span class="line"><span class="cl">git commit -m <span class="s2">&#34;message&#34;</span>
</span></span><span class="line"><span class="cl">git commit --amend              <span class="c1"># edit last commit</span></span></span></code></pre></div></div>
<h2 id="branching">Branching</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git branch                      <span class="c1"># list branches</span>
</span></span><span class="line"><span class="cl">git branch &lt;name&gt;               <span class="c1"># create branch</span>
</span></span><span class="line"><span class="cl">git checkout -b &lt;name&gt;          <span class="c1"># create + switch</span>
</span></span><span class="line"><span class="cl">git switch &lt;name&gt;               <span class="c1"># switch (modern)</span>
</span></span><span class="line"><span class="cl">git branch -d &lt;name&gt;            <span class="c1"># delete</span></span></span></code></pre></div></div>
<h2 id="remote">Remote</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git remote -v                   <span class="c1"># list remotes</span>
</span></span><span class="line"><span class="cl">git fetch                       <span class="c1"># fetch without merging</span>
</span></span><span class="line"><span class="cl">git pull                        <span class="c1"># fetch + merge</span>
</span></span><span class="line"><span class="cl">git push origin &lt;branch&gt;
</span></span><span class="line"><span class="cl">git push -u origin &lt;branch&gt;     <span class="c1"># set upstream</span></span></span></code></pre></div></div>
<h2 id="undo">Undo</h2>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <span class="code-title"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></span>
        <span class="ellipses"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <span class="copy" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></span>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git restore &lt;file&gt;              <span class="c1"># discard working tree changes</span>
</span></span><span class="line"><span class="cl">git reset HEAD &lt;file&gt;           <span class="c1"># unstage</span>
</span></span><span class="line"><span class="cl">git reset --soft HEAD~1         <span class="c1"># undo last commit (keep changes)</span>
</span></span><span class="line"><span class="cl">git revert &lt;hash&gt;               <span class="c1"># safe undo (creates new commit)</span></span></span></code></pre></div></div>]]></description></item></channel></rss>