<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Understanding Git Internals]]></title><description><![CDATA[Understanding Git Internals]]></description><link>https://understanding-git-internals.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 21:52:23 GMT</lastBuildDate><atom:link href="https://understanding-git-internals.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Inside Git: How Git Works and the Role of the .git Folder]]></title><description><![CDATA[How Git Works Internally
Git does not save the entire file every time. Git stores file data in the form of objects.
Internally, Git works on the following concepts:
Content-based tracking (the content of the file
Snapshot system (each commit is a sna...]]></description><link>https://understanding-git-internals.hashnode.dev/inside-git-how-git-works-and-the-role-of-the-git-folder</link><guid isPermaLink="true">https://understanding-git-internals.hashnode.dev/inside-git-how-git-works-and-the-role-of-the-git-folder</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><dc:creator><![CDATA[Akmal Faiz]]></dc:creator><pubDate>Thu, 01 Jan 2026 06:32:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767249069391/1e43d8ab-a401-48f5-8cc5-3a02c363c18c.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-how-git-works-internally">How Git Works Internally</h1>
<p>Git does not save the entire file every time. Git stores file data in the form of objects.</p>
<p><strong>Internally, Git works on the following concepts</strong>:</p>
<p><strong>Content-based tracking</strong> (the content of the file</p>
<p><strong>Snapshot system</strong> (each commit is a snapshot)</p>
<p>Use of <strong>hashes (SHA-1 / SHA-256)</strong></p>
<p><strong>Git assigns a unique hash ID to every change.</strong></p>
<h1 id="heading-understanding-the-git-folder">Understanding the .git Folder</h1>
<p>The <strong>.git folder</strong> is the brain of your project. It stores all the information, history, and settings related to your project that Git (a version control system) needs. When you run the git init command, this folder is created.</p>
<p>This folder is usually <strong>hidden</strong>, and it keeps a record of <strong>every change</strong> made to your code. Because of this, you can go back to any previous version at any time and see <strong>who made which changes</strong>.</p>
<p><strong>It stores the following:</strong></p>
<p><strong>Commit history</strong></p>
<p><strong>Branches</strong></p>
<p><strong>Configuration</strong></p>
<p><strong>Git objects</strong> (blob, tree, commit)</p>
<p>  <strong>HEAD pointer</strong></p>
<p> If the <code>.git</code> folder is deleted<br /> your entire Git history will be lost.</p>
<h1 id="heading-ia"> </h1>
<p><strong>Git Objects: Blob, Tree, and Commit</strong></p>
<p>Git stores data in the form of objects:</p>
<p><strong>1.  Blob (Binary Large Object)</strong></p>
<p>  Stores the content of files.  </p>
<ol start="2">
<li><p><strong>Tree</strong></p>
<p>Manages the project’s directory tree and links to blobs and other trees.</p>
<p><strong>3. Commit</strong></p>
<p>A commit is a snapshot, which contains:</p>
</li>
</ol>
<ul>
<li><p>Author</p>
</li>
<li><p>Date &amp; Time</p>
</li>
<li><p>Message</p>
</li>
<li><p>Parent commit</p>
</li>
<li><p>Reference to the tree object</p>
</li>
</ul>
<p>The complete state of the project at that point in time.</p>
<h1 id="heading-how-git-tracks-changes">How Git Tracks Changes</h1>
<p>   There are 3 main stages in Git:</p>
<p> <strong>1. Working Directory</strong></p>
<ul>
<li>Where you edit files</li>
</ul>
<p> <strong>2. Staging Area</strong></p>
<ul>
<li><p>Files go here using git add</p>
</li>
<li><p>They are prepared for commit</p>
</li>
</ul>
<p> <strong>3. Repository</strong></p>
<ul>
<li><p>After git commit, files are permanently saved here</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767248724476/6718f8a7-7ae0-4261-a567-354fa3789c95.png" alt class="image--center mx-auto" /></p>
</li>
</ul>
]]></content:encoded></item></channel></rss>