<?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[Inside Git by Varsha K]]></title><description><![CDATA[Inside Git by Varsha K]]></description><link>https://inside-git-by-varsha-k.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 05 Oct 2026 14:43:16 GMT</lastBuildDate><atom:link href="https://inside-git-by-varsha-k.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Inside Git: How it Works and the Role of the . git Folder]]></title><description><![CDATA[Most of us use Git daily with commands like git add, git commit, and git push.
But have you ever wondered what Git actually does behind the scenes? 🤔
In this article, we’ll understand how Git works internally, using easy language, real-life analogie...]]></description><link>https://inside-git-by-varsha-k.hashnode.dev/inside-git-how-it-works-and-the-role-of-the-git-folder</link><guid isPermaLink="true">https://inside-git-by-varsha-k.hashnode.dev/inside-git-how-it-works-and-the-role-of-the-git-folder</guid><dc:creator><![CDATA[Varsha Kamble]]></dc:creator><pubDate>Sat, 17 Jan 2026 14:14:31 GMT</pubDate><content:encoded><![CDATA[<p>Most of us use Git daily with commands like git add, git commit, and git push.</p>
<p>But have you ever wondered what Git actually does behind the scenes? 🤔</p>
<p>In this article, we’ll understand how Git works internally, using easy language, real-life analogies, and zero complex theory.</p>
<p>1. How Git Works Internally</p>
<p>Think of Git as a smart photo album 📸 for your code.</p>
<p>Every time you save (commit), Git takes a snapshot of your project</p>
<p>Git does not save full copies again and again</p>
<p>Instead, it saves only what has changed</p>
<p>So Git is:</p>
<p>Fast ⚡</p>
<p>Storage efficient 📦</p>
<p>Reliable 🔐</p>
<p>Internally, Git stores everything as objects inside a hidden folder called .git.</p>
<p>2. Understanding the .git Folder</p>
<p>When you run:</p>
<p>git init</p>
<p>Git creates a hidden folder called .git.</p>
<p>This folder is the brain 🧠 of Git.</p>
<p>Important folders inside .git</p>
<p>Folder/File</p>
<p>What it does (Simple)</p>
<p>objects/</p>
<p>Stores all code data (files, commits, folders)</p>
<p>refs/</p>
<p>Stores branch names and pointers</p>
<p>HEAD</p>
<p>Tells which branch you are currently on</p>
<p>index</p>
<p>Temporary area (staging area)</p>
<p>👉 If you delete the .git folder, your project is no longer a Git repository.</p>
<p>3. Git Objects: Blob, Tree, Commit</p>
<p>Git stores everything as objects.</p>
<p>There are 3 main object types.</p>
<p>1️⃣ Blob (File content)</p>
<p>Blob stores file content</p>
<p>It does NOT store file name</p>
<p>Same content = same blob (even if file name changes)</p>
<p>📄 Example:</p>
<p>Hello World</p>
<p>If two files have this same content, Git stores it only once.</p>
<p>2️⃣ Tree (Folder structure)</p>
<p>Tree stores file names + folder structure</p>
<p>It points to blobs and other trees</p>
<p>📁 Example:</p>
<p>project/</p>
<p>├── app.py</p>
<p>└── utils.py</p>
<p>Tree knows:</p>
<p>File names</p>
<p>Folder hierarchy</p>
<p>Which blob belongs to which file</p>
<p>3️⃣ Commit (Snapshot info)</p>
<p>Commit is like a label on a snapshot 🏷️</p>
<p>It contains:</p>
<p>Pointer to tree (project structure)</p>
<p>Author name</p>
<p>Date &amp; time</p>
<p>Commit message</p>
<p>Parent commit reference</p>
<p>📝 Example:</p>
<p>"Added login feature"</p>
<p>4. How Git Tracks Changes</p>
<p>Git does NOT track changes line by line like Word documents.</p>
<p>Instead, Git:</p>
<p>Compares snapshots</p>
<p>Saves only new or changed content</p>
<p>What happens step-by-step?</p>
<p>Step 1: Modify a file</p>
<p>You edit main.py</p>
<p>Step 2: git add main.py</p>
<p>Git creates a blob</p>
<p>Stores it inside .git/objects</p>
<p>Updates the index (staging area)</p>
<p>Step 3: git commit</p>
<p>Git creates a tree</p>
<p>Git creates a commit</p>
<p>Commit points to the tree</p>
<p>Tree points to blobs</p>
<p>🎯 Result: A complete snapshot is saved efficiently.</p>
<p>Real-Life Analogy 🧠</p>
<p>Think of Git like a library system 📚</p>
<p>Blob → Page content</p>
<p>Tree → Book structure (chapters, pages)</p>
<p>Commit → Edition of the book</p>
<p>Branch → Different versions of the same book</p>
<p>Git only stores new pages, not the entire book again.</p>
]]></content:encoded></item></channel></rss>