<?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[My Tech Diary]]></title><description><![CDATA[My Tech Diary]]></description><link>https://nishutechdiary.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1768626701702/76e6de50-ae96-4787-84cd-7d246e1aa476.png</url><title>My Tech Diary</title><link>https://nishutechdiary.com</link></image><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 08:11:25 GMT</lastBuildDate><atom:link href="https://nishutechdiary.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[DNS :  In Depth]]></title><description><![CDATA[DNS Explained with dig: From Root Servers to Google.com
When you type google.com into your browser, a surprising amount of distributed system machinery spins up behind the scenes.At the heart of it all is DNS — the Domain Name System.
This article br...]]></description><link>https://nishutechdiary.com/dns-in-depth</link><guid isPermaLink="true">https://nishutechdiary.com/dns-in-depth</guid><dc:creator><![CDATA[Nishu Singh]]></dc:creator><pubDate>Sat, 24 Jan 2026 13:43:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/3GZNPBLImWc/upload/70e5f5c4ccb4bcdbd717bc4ee03ca84e.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-dns-explained-with-dig-from-root-servers-to-googlecomhttpgooglecom">DNS Explained with <code>dig</code>: From Root Servers to <a target="_blank" href="http://Google.com">Google.com</a></h1>
<p>When you type <a target="_blank" href="http://google.com"><code>google.com</code></a> into your browser, a surprising amount of distributed system machinery spins up behind the scenes.<br />At the heart of it all is <strong>DNS — the Domain Name System</strong>.</p>
<p>This article breaks DNS down layer by layer using the <code>dig</code> command, so you can <em>see</em> how name resolution actually works instead of memorizing theory.</p>
<hr />
<h2 id="heading-dns-the-internets-phonebook">DNS: The Internet’s Phonebook ☎️</h2>
<p>Humans remember names.<br />Machines route traffic using IP addresses.</p>
<p>DNS exists to translate <strong>human-friendly domain names</strong> like:</p>
<pre><code class="lang-plaintext">google.com
</code></pre>
<p>into <strong>machine-friendly IP addresses</strong> like:</p>
<pre><code class="lang-plaintext">142.250.190.14
</code></pre>
<p>Without DNS, we’d be browsing the internet by typing numbers—clearly not ideal.</p>
<p>Key idea:</p>
<blockquote>
<p><strong>DNS is a globally distributed, hierarchical database optimized for reads.</strong></p>
</blockquote>
<hr />
<h2 id="heading-introducing-dig-your-dns-x-ray-tool">Introducing <code>dig</code>: Your DNS X-Ray Tool 🔍</h2>
<p><code>dig</code> (Domain Information Groper) is a command-line tool that lets you <strong>inspect DNS resolution at every layer</strong>.</p>
<p>You use <code>dig</code> when you want to:</p>
<ul>
<li><p>Debug DNS issues</p>
</li>
<li><p>Understand name server delegation</p>
</li>
<li><p>See authoritative vs recursive behavior</p>
</li>
<li><p>Learn how browsers actually resolve domains</p>
</li>
</ul>
<p>Basic syntax:</p>
<pre><code class="lang-plaintext">dig &lt;name&gt; &lt;record-type&gt;
</code></pre>
<hr />
<h2 id="heading-dns-resolution-happens-in-layers">DNS Resolution Happens in Layers</h2>
<p>DNS resolution is <strong>not a single lookup</strong>.<br />It’s a chain of delegations:</p>
<p><img src="https://substackcdn.com/image/fetch/%24s_%21P_Ol%21%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0a1bb2c-a1bc-40ce-abde-6fb9d2a66ce8_1600x570.png" alt="https://substackcdn.com/image/fetch/%24s_%21P_Ol%21%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0a1bb2c-a1bc-40ce-abde-6fb9d2a66ce8_1600x570.png" /></p>
<p><img src="https://substackcdn.com/image/fetch/%24s_%21_iP7%21%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a5ed500-6b67-4b36-b6fc-fe04d8b02914_2876x1697.png" alt="https://substackcdn.com/image/fetch/%24s_%21_iP7%21%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8a5ed500-6b67-4b36-b6fc-fe04d8b02914_2876x1697.png" /></p>
<p><img src="https://www.researchgate.net/publication/342547942/figure/fig1/AS%3A907969327800320%401593488165786/llustration-of-DNS-resolution-over-recursive-root-TLD-and-authoritative-name-server.png" alt="https://www.researchgate.net/publication/342547942/figure/fig1/AS%3A907969327800320%401593488165786/llustration-of-DNS-resolution-over-recursive-root-TLD-and-authoritative-name-server.png" /></p>
<p>4</p>
<pre><code class="lang-plaintext">Root servers (.)
   ↓
TLD servers (.com, .org, .net)
   ↓
Authoritative servers (google.com)
</code></pre>
<p>Let’s walk this hierarchy using <code>dig</code>.</p>
<hr />
<h2 id="heading-dig-ns-root-name-servers"><code>dig . NS</code> — Root Name Servers 🌍</h2>
<pre><code class="lang-plaintext">dig . NS
</code></pre>
<p>This asks:</p>
<blockquote>
<p>“Who is authoritative for the <strong>root zone</strong>?”</p>
</blockquote>
<h3 id="heading-what-youll-see">What you’ll see</h3>
<ul>
<li><p>Servers like <a target="_blank" href="http://a.root-servers.net"><code>a.root-servers.net</code></a></p>
</li>
<li><p>Managed by organizations like Verisign, ICANN, etc.</p>
</li>
</ul>
<p>Key points:</p>
<ul>
<li><p>There are <strong>13 logical root servers</strong> (A–M)</p>
</li>
<li><p>Each is anycasted globally (hundreds of physical instances)</p>
</li>
<li><p>Root servers <strong>do not know IPs for</strong> <a target="_blank" href="http://google.com"><strong>google.com</strong></a></p>
</li>
<li><p>They only know <strong>where</strong> <code>.com</code> lives</p>
</li>
</ul>
<p>Think of them as:</p>
<blockquote>
<p>“I don’t know the answer, but I know who to ask next.”</p>
</blockquote>
<hr />
<h2 id="heading-dig-com-ns-tld-name-servers"><code>dig com NS</code> — TLD Name Servers 📛</h2>
<pre><code class="lang-plaintext">dig com NS
</code></pre>
<p>This queries the <strong>Top-Level Domain (TLD)</strong> servers for <code>.com</code>.</p>
<h3 id="heading-what-this-tells-us">What this tells us</h3>
<ul>
<li><p><code>.com</code> is managed by <strong>Verisign</strong></p>
</li>
<li><p>These servers know:</p>
<ul>
<li>Which name servers are authoritative for <a target="_blank" href="http://google.com"><code>google.com</code></a></li>
</ul>
</li>
<li><p>They <strong>still don’t know</strong> <a target="_blank" href="http://google.com"><strong>google.com</strong></a><strong>’s IP</strong></p>
</li>
</ul>
<p>TLD servers act as:</p>
<blockquote>
<p>A directory of domains registered under <code>.com</code></p>
</blockquote>
<hr />
<h2 id="heading-dig-googlecomhttpgooglecom-ns-authoritative-name-servers"><code>dig</code> <a target="_blank" href="http://google.com"><code>google.com</code></a> <code>NS</code> — Authoritative Name Servers 🏛️</h2>
<pre><code class="lang-plaintext">dig google.com NS
</code></pre>
<p>Now we’re asking:</p>
<blockquote>
<p>“Who is authoritative for <a target="_blank" href="http://google.com"><code>google.com</code></a>?”</p>
</blockquote>
<h3 id="heading-output-highlights">Output highlights</h3>
<ul>
<li><p>Name servers like:</p>
<pre><code class="lang-plaintext">  ns1.google.com
  ns2.google.com
  ns3.google.com
  ns4.google.com
</code></pre>
</li>
</ul>
<p>These servers:</p>
<ul>
<li><p>Are controlled by Google</p>
</li>
<li><p>Hold the <strong>actual DNS records</strong></p>
</li>
<li><p>Provide final answers (A, AAAA, MX, TXT, etc.)</p>
</li>
</ul>
<p>This is where <strong>truth lives</strong> in DNS.</p>
<hr />
<h2 id="heading-dig-googlecomhttpgooglecom-full-dns-resolution"><code>dig</code> <a target="_blank" href="http://google.com"><code>google.com</code></a> — Full DNS Resolution 🔄</h2>
<pre><code class="lang-plaintext">dig google.com
</code></pre>
<p>This returns:</p>
<ul>
<li><p><code>A</code> records (IPv4)</p>
</li>
<li><p>Possibly <code>AAAA</code> records (IPv6)</p>
</li>
<li><p>TTL values</p>
</li>
<li><p>Which server answered the query</p>
</li>
</ul>
<p>But here’s the important part:</p>
<blockquote>
<p><strong>Your system did not query root → TLD → authoritative directly.</strong></p>
</blockquote>
<p>Instead, this was handled by a <strong>recursive resolver</strong>.</p>
<hr />
<h2 id="heading-recursive-resolvers-the-hidden-middleman">Recursive Resolvers: The Hidden Middleman 🧠</h2>
<p>Your laptop/browser typically asks:</p>
<ul>
<li><p>ISP DNS</p>
</li>
<li><p>Google DNS (<code>8.8.8.8</code>)</p>
</li>
<li><p>Cloudflare (<code>1.1.1.1</code>)</p>
</li>
</ul>
<p><img src="https://www.researchgate.net/publication/330006223/figure/fig1/AS%3A709642057445377%401546203259697/Domain-resolution-process-with-a-recursive-resolver.ppm" alt="https://www.researchgate.net/publication/330006223/figure/fig1/AS%3A709642057445377%401546203259697/Domain-resolution-process-with-a-recursive-resolver.ppm" /></p>
<p><img src="https://media.geeksforgeeks.org/wp-content/uploads/20220713172800/RecursiveDNS1.png" alt="https://media.geeksforgeeks.org/wp-content/uploads/20220713172800/RecursiveDNS1.png" /></p>
<p><img src="https://images.openai.com/thumbnails/url/oHTed3icu5mZUVJSUGylr5-al1xUWVCSmqJbkpRnoJdeXJJYkpmsl5yfq5-Zm5ieWmxfaAuUsXL0S7F0Tw4yznAL94kwDHD2SvF19DcPKYmM1E13C8jxCisL0jVI9MlNdU92DTJMjExKLa3wD_NVKwYAOzAlYA" alt="https://i.sstatic.net/00S6Q.jpg" /></p>
<p>4</p>
<h3 id="heading-what-the-recursive-resolver-does">What the recursive resolver does</h3>
<ol>
<li><p>Ask root servers for <code>.com</code></p>
</li>
<li><p>Ask <code>.com</code> servers for <a target="_blank" href="http://google.com"><code>google.com</code></a></p>
</li>
<li><p>Ask Google’s authoritative servers for IP</p>
</li>
<li><p>Cache the result</p>
</li>
<li><p>Return the IP to your browser</p>
</li>
</ol>
<p>All in milliseconds.</p>
<hr />
<h2 id="heading-mapping-dig-commands-to-dns-stages">Mapping <code>dig</code> Commands to DNS Stages</h2>
<p><img src="https://substackcdn.com/image/fetch/%24s_%21piIO%21%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1adddd56-9fb5-4dc4-ad1a-0faea938acf0_2284x2054.png" alt="https://substackcdn.com/image/fetch/%24s_%21piIO%21%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1adddd56-9fb5-4dc4-ad1a-0faea938acf0_2284x2054.png" /></p>
<p><img src="https://scribbledtech.com/wp-content/uploads/2023/02/image-10-1024x924.png" alt="https://scribbledtech.com/wp-content/uploads/2023/02/image-10-1024x924.png" /></p>
<p><img src="https://miro.medium.com/v2/resize%3Afit%3A1400/1%2AKK0uKAzIfDB3ivc-7J8OtQ.jpeg" alt="https://miro.medium.com/v2/resize%3Afit%3A1400/1%2AKK0uKAzIfDB3ivc-7J8OtQ.jpeg" /></p>
<p>4</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><code>dig</code> Command</td><td>DNS Layer</td></tr>
</thead>
<tbody>
<tr>
<td><code>dig . NS</code></td><td>Root name servers</td></tr>
<tr>
<td><code>dig com NS</code></td><td>TLD servers</td></tr>
<tr>
<td><code>dig</code> <a target="_blank" href="http://google.com"><code>google.com</code></a> <code>NS</code></td><td>Authoritative servers</td></tr>
<tr>
<td><code>dig</code> <a target="_blank" href="http://google.com"><code>google.com</code></a></td><td>Full resolution via recursive resolver</td></tr>
</tbody>
</table>
</div><p>This mapping is gold for <strong>system design interviews</strong>.</p>
<hr />
<h2 id="heading-why-ns-records-matter-in-system-design">Why NS Records Matter in System Design</h2>
<p>NS records:</p>
<ul>
<li><p>Enable <strong>horizontal scaling</strong> of DNS</p>
</li>
<li><p>Allow delegation without central coordination</p>
</li>
<li><p>Prevent single points of failure</p>
</li>
<li><p>Make DNS one of the most resilient systems ever built</p>
</li>
</ul>
<p>Design insight:</p>
<blockquote>
<p>DNS works because <em>no server needs to know everything</em>.</p>
</blockquote>
<hr />
<h2 id="heading-connecting-dns-to-real-browser-requests">Connecting DNS to Real Browser Requests 🌐</h2>
<p>When you type <a target="_blank" href="https://google.com"><code>https://google.com</code></a>:</p>
<ol>
<li><p>DNS resolves <a target="_blank" href="http://google.com"><code>google.com</code></a> → IP</p>
</li>
<li><p>TCP connection is established</p>
</li>
<li><p>TLS handshake happens</p>
</li>
<li><p>HTTP request is sent</p>
</li>
</ol>
<p>If DNS fails:</p>
<ul>
<li>Nothing else even starts</li>
</ul>
<p>That’s why DNS latency and availability are <strong>critical</strong> at scale.</p>
<hr />
<h2 id="heading-final-takeaways">Final Takeaways</h2>
<ul>
<li><p>DNS is a <strong>hierarchical, distributed database</strong></p>
</li>
<li><p><code>dig</code> lets you observe DNS like a systems engineer</p>
</li>
<li><p>Root → TLD → Authoritative is the backbone of resolution</p>
</li>
<li><p>Recursive resolvers hide complexity but rely on this hierarchy</p>
</li>
<li><p>Understanding DNS deeply pays off in <strong>backend, infra, and SRE roles</strong></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Why Version Control Exists: The Pendrive Era of Software Development 💾]]></title><description><![CDATA[Before Git, GitHub, and modern collaboration tools, software development looked very different — and honestly, a bit chaotic.
If you’ve ever seen folders named final, final_v2, or latest_final_REAL, then you already understand why version control exi...]]></description><link>https://nishutechdiary.com/why-version-control-exists-the-pendrive-era-of-software-development</link><guid isPermaLink="true">https://nishutechdiary.com/why-version-control-exists-the-pendrive-era-of-software-development</guid><dc:creator><![CDATA[Nishu Singh]]></dc:creator><pubDate>Sat, 17 Jan 2026 04:10:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/wX2L8L-fGeA/upload/64c3a83e58cf2469ce5b69b29c5e1d2d.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Before Git, GitHub, and modern collaboration tools, software development looked very different — and honestly, a bit chaotic.</p>
<p>If you’ve ever seen folders named <code>final</code>, <code>final_v2</code>, or <code>latest_final_REAL</code>, then you already understand <strong>why version control exists</strong>.</p>
<p>Let’s go back in time.</p>
<hr />
<h2 id="heading-life-before-version-control-systems">Life Before Version Control Systems</h2>
<p>Imagine a team of developers working on the same project…<br />without Git, without cloud repos, without history tracking.</p>
<p>How did they share code?</p>
<ul>
<li><p>Pendrives (USB drives)</p>
</li>
<li><p>Email attachments</p>
</li>
<li><p>Shared folders</p>
</li>
<li><p>Manual backups</p>
</li>
</ul>
<p>It worked — until it didn’t.</p>
<hr />
<h2 id="heading-the-pendrive-analogy">The Pendrive Analogy 🧠</h2>
<p>Think of a <strong>pendrive</strong> as the “source of truth”.</p>
<h3 id="heading-typical-workflow-back-then">Typical Workflow Back Then</h3>
<ol>
<li><p>Developer A copies the project to a pendrive</p>
</li>
<li><p>Makes changes</p>
</li>
<li><p>Hands the pendrive to Developer B</p>
</li>
<li><p>Developer B overwrites their local copy</p>
</li>
<li><p>Someone forgets to copy a file</p>
</li>
<li><p>Chaos begins 😅</p>
</li>
</ol>
<p><img src="https://images.openai.com/thumbnails/url/5m4OFXicu5mZUVJSUGylr5-al1xUWVCSmqJbkpRnoJdeXJJYkpmsl5yfq5-Zm5ieWmxfaAuUsXL0S7F0Tw7ONgvPK3HJ9TI2KynN9jYtrzBN9LHwdQoqywvMcXH3j0r0TQ0z8wz1LSwL07XM90lWKwYAW5Ql9Q" alt="https://www.researchgate.net/publication/367618896/figure/fig3/AS%3A11431281116217713%401675196080313/File-sharing-process-flow.jpg" /></p>
<p><img src="https://images.openai.com/thumbnails/url/Yua6gHicu5mZUVJSUGylr5-al1xUWVCSmqJbkpRnoJdeXJJYkpmsl5yfq5-Zm5ieWmxfaAuUsXL0S7F0Tw7KN_IMTimPtMhOM4pPrbTICiyKDHE3KMnyqwrNMfX18DIziM9OCamoCK4oCKoyDPNVKwYAYokmeA" alt="https://www.researchgate.net/publication/301205646/figure/fig2/AS%3A349962245296129%401460448909524/File-transfer-flow-chart-between-the-server-and-the-file-server.png" /></p>
<p>There was <strong>no system</strong>, just trust and hope.</p>
<hr />
<h2 id="heading-the-famous-folder-names">The Famous Folder Names 😬</h2>
<p>Developers tried to protect themselves by duplicating folders:</p>
<pre><code class="lang-plaintext">project/
├── final/
├── final_v2/
├── final_v2_updated/
├── final_latest/
├── final_latest_REAL/
</code></pre>
<p>Each folder was a <strong>manual version</strong> of the project.</p>
<p>Problems?</p>
<ul>
<li><p>No idea what actually changed</p>
</li>
<li><p>No clarity on which version is correct</p>
</li>
<li><p>Huge waste of time and storage</p>
</li>
</ul>
<hr />
<h2 id="heading-problems-faced-before-version-control">Problems Faced Before Version Control</h2>
<p>Let’s break down the real issues.</p>
<hr />
<h3 id="heading-1-overwriting-code">1. Overwriting Code</h3>
<p>Two developers edited the same file.</p>
<ul>
<li><p>Developer A updates <code>login.js</code></p>
</li>
<li><p>Developer B updates <code>login.js</code></p>
</li>
<li><p>One copy overwrites the other</p>
</li>
</ul>
<p>💥 Someone’s work is gone forever.</p>
<p><img src="https://www.cloudfulcrum.com/wp-content/uploads/2024/09/Possibility-of-Overwrites.jpg" alt="https://www.cloudfulcrum.com/wp-content/uploads/2024/09/Possibility-of-Overwrites.jpg" /></p>
<p><img src="https://2muchcoffee.com/blog/content/images/2018/07/can_you_tell_us_that_web_or_mobile.png" alt="https://2muchcoffee.com/blog/content/images/2018/07/can_you_tell_us_that_web_or_mobile.png" /></p>
<hr />
<h3 id="heading-2-no-history-of-changes">2. No History of Changes</h3>
<p>Questions no one could answer:</p>
<ul>
<li><p>Who changed this?</p>
</li>
<li><p>When did it break?</p>
</li>
<li><p>What was the working version yesterday?</p>
</li>
</ul>
<p>There was <strong>no audit trail</strong>.</p>
<hr />
<h3 id="heading-3-lost-changes">3. Lost Changes</h3>
<p>Files got lost due to:</p>
<ul>
<li><p>Accidental deletes</p>
</li>
<li><p>System crashes</p>
</li>
<li><p>Wrong folder copied</p>
</li>
<li><p>Pendrive corruption</p>
</li>
</ul>
<p>Once lost → <strong>unrecoverable</strong>.</p>
<hr />
<h3 id="heading-4-no-collaboration-model">4. No Collaboration Model</h3>
<p>Teams couldn’t:</p>
<ul>
<li><p>Work in parallel</p>
</li>
<li><p>Experiment safely</p>
</li>
<li><p>Review each other’s changes</p>
</li>
</ul>
<p>Everything had to be sequential — one person at a time.</p>
<hr />
<h3 id="heading-5-no-rollback">5. No Rollback</h3>
<p>If a new change broke the app:</p>
<ul>
<li><p>There was no “go back”</p>
</li>
<li><p>Only guesswork and panic</p>
</li>
</ul>
<p>🚫 No undo button.</p>
<hr />
<h2 id="heading-visualizing-the-problem-timeline-chaos">Visualizing the Problem: Timeline Chaos</h2>
<p><img src="https://learn.microsoft.com/en-us/sharepoint/sharepointonline/media/version-history/how-ver-lim-app.png" alt="https://learn.microsoft.com/en-us/sharepoint/sharepointonline/media/version-history/how-ver-lim-app.png" /></p>
<p><img src="https://www.reneelab.com/wp-content/uploads/sites/2/2019/05/recover-overwritten-files-in-pc.png" alt="https://www.reneelab.com/wp-content/uploads/sites/2/2019/05/recover-overwritten-files-in-pc.png" /></p>
<p>Versions jumped randomly:</p>
<ul>
<li><p>v1 → v3 → v2 → broken</p>
</li>
<li><p>No clean history</p>
</li>
<li><p>No confidence</p>
</li>
</ul>
<hr />
<h2 id="heading-why-version-control-became-necessary">Why Version Control Became Necessary</h2>
<p>As software grew:</p>
<ul>
<li><p>Teams became larger</p>
</li>
<li><p>Codebases became complex</p>
</li>
<li><p>Releases became frequent</p>
</li>
</ul>
<p>Manual methods <strong>could not scale</strong>.</p>
<p>Developers needed a system that could:</p>
<ul>
<li><p>Track every change</p>
</li>
<li><p>Preserve history</p>
</li>
<li><p>Support collaboration</p>
</li>
<li><p>Prevent overwrites</p>
</li>
<li><p>Allow rollback</p>
</li>
</ul>
<p>That system is <strong>Version Control</strong>.</p>
<hr />
<h2 id="heading-version-control-vs-pendrive-workflow">Version Control vs Pendrive Workflow</h2>
<p><img src="https://miro.medium.com/v2/resize%3Afit%3A1400/0%2ADo3JBoZfXDtwBf8s.png" alt="https://miro.medium.com/v2/resize%3Afit%3A1400/0%2ADo3JBoZfXDtwBf8s.png" /></p>
<p><img src="https://www.perforce.com/sites/default/files/inline-images/vcs_p4_blog_what-is-version-control_p4-branching-merging-pushing-workflow-cvcs.png" alt="https://www.perforce.com/sites/default/files/inline-images/vcs_p4_blog_what-is-version-control_p4-branching-merging-pushing-workflow-cvcs.png" /></p>
<h3 id="heading-pendrive-workflow">Pendrive Workflow ❌</h3>
<ul>
<li><p>One copy at a time</p>
</li>
<li><p>No history</p>
</li>
<li><p>Manual backups</p>
</li>
<li><p>High risk</p>
</li>
</ul>
<h3 id="heading-version-control-workflow">Version Control Workflow ✅</h3>
<ul>
<li><p>Everyone works independently</p>
</li>
<li><p>Full change history</p>
</li>
<li><p>Automatic backups</p>
</li>
<li><p>Safe collaboration</p>
</li>
</ul>
<hr />
<h2 id="heading-how-version-control-solves-these-problems">How Version Control Solves These Problems</h2>
<p>Version control systems:</p>
<ul>
<li><p>Track <strong>who</strong> changed <strong>what</strong> and <strong>when</strong></p>
</li>
<li><p>Prevent accidental overwrites</p>
</li>
<li><p>Allow multiple developers to work in parallel</p>
</li>
<li><p>Provide rollback to any previous state</p>
</li>
<li><p>Maintain a clean project timeline</p>
</li>
</ul>
<p>In short:</p>
<blockquote>
<p>Version control replaces chaos with confidence.</p>
</blockquote>
<hr />
<h2 id="heading-why-version-control-is-mandatory-today">Why Version Control Is Mandatory Today</h2>
<p>Modern development depends on:</p>
<ul>
<li><p>Remote teams</p>
</li>
<li><p>CI/CD pipelines</p>
</li>
<li><p>Open-source collaboration</p>
</li>
<li><p>Fast release cycles</p>
</li>
</ul>
<p>Without version control:<br />🚫 None of this is possible.</p>
<p>That’s why learning Git isn’t optional — it’s foundational.</p>
<hr />
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>The pendrive era taught developers a hard lesson:<br /><strong>Manual versioning doesn’t work at scale.</strong></p>
<p>Version control exists because:</p>
<ul>
<li><p>Humans make mistakes</p>
</li>
<li><p>Teams need coordination</p>
</li>
<li><p>Software must evolve safely</p>
</li>
</ul>
<p>Once you understand this history, Git no longer feels like “just another tool” —<br />it feels like a <strong>solution to a real problem</strong>.</p>
]]></content:encoded></item><item><title><![CDATA[How Git Works Internally: Building a Mental Model 🧠]]></title><description><![CDATA[Most developers learn Git by memorizing commands like git add and git commit.But Git becomes much easier once you understand what’s happening under the hood.
In this article, we’ll explore:

What the .git folder really is

How Git stores data interna...]]></description><link>https://nishutechdiary.com/how-git-works-internally-building-a-mental-model</link><guid isPermaLink="true">https://nishutechdiary.com/how-git-works-internally-building-a-mental-model</guid><dc:creator><![CDATA[Nishu Singh]]></dc:creator><pubDate>Sat, 17 Jan 2026 04:08:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/842ofHC6MaI/upload/0d3b235474a810d9e838c81717cf15aa.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Most developers learn Git by memorizing commands like <code>git add</code> and <code>git commit</code>.<br />But Git becomes <em>much easier</em> once you understand <strong>what’s happening under the hood</strong>.</p>
<p>In this article, we’ll explore:</p>
<ul>
<li><p>What the <code>.git</code> folder really is</p>
</li>
<li><p>How Git stores data internally</p>
</li>
<li><p>Git objects: <strong>Blob, Tree, Commit</strong></p>
</li>
<li><p>What actually happens during <code>git add</code> and <code>git commit</code></p>
</li>
<li><p>How Git uses hashes to protect your data</p>
</li>
</ul>
<p>No advanced math, no magic — just clear concepts.</p>
<hr />
<h2 id="heading-why-understanding-git-internals-matters">Why Understanding Git Internals Matters</h2>
<p>When you understand Git internally:</p>
<ul>
<li><p>You stop guessing and start reasoning</p>
</li>
<li><p>Commands make logical sense</p>
</li>
<li><p>Debugging Git issues becomes easier</p>
</li>
<li><p>You rely less on memorization</p>
</li>
</ul>
<p>Think of this as learning <strong>how Git thinks</strong>.</p>
<hr />
<h2 id="heading-what-is-the-git-folder">What Is the <code>.git</code> Folder?</h2>
<p>When you run:</p>
<pre><code class="lang-plaintext">git init
</code></pre>
<p>Git creates a hidden folder called:</p>
<pre><code class="lang-plaintext">.git/
</code></pre>
<p>This folder is the <strong>heart of Git</strong>.</p>
<h3 id="heading-important-rule">Important Rule</h3>
<p>👉 <strong>Your project is not a Git repository because of Git commands —<br />it’s a repository because the</strong> <code>.git</code> folder exists.</p>
<p>Delete <code>.git</code>, and Git forgets everything.</p>
<hr />
<h2 id="heading-whats-inside-the-git-folder">What’s Inside the <code>.git</code> Folder?</h2>
<p><img src="https://humbletoolsmith.com/img/posts/a-look-inside-the-_git-folder/Git%20Folder%20Internals.png" alt="https://humbletoolsmith.com/img/posts/a-look-inside-the-_git-folder/Git%20Folder%20Internals.png" /></p>
<p><img src="https://git-scm.com/book/en/v2/images/data-model-3.png" alt="https://git-scm.com/book/en/v2/images/data-model-3.png" /></p>
<p>A simplified view:</p>
<pre><code class="lang-plaintext">.git/
├── objects/
├── refs/
├── HEAD
├── index
├── config
</code></pre>
<p>Let’s focus on the most important parts.</p>
<hr />
<h3 id="heading-1-objects-where-git-stores-everything">1. <code>objects/</code> – Where Git Stores Everything</h3>
<p>This is Git’s <strong>database</strong>.</p>
<ul>
<li><p>Every file</p>
</li>
<li><p>Every folder</p>
</li>
<li><p>Every commit</p>
</li>
</ul>
<p>All are stored here as <strong>objects</strong>.</p>
<hr />
<h3 id="heading-2-head-where-you-are-right-now">2. <code>HEAD</code> – Where You Are Right Now</h3>
<p><code>HEAD</code> points to:</p>
<ul>
<li><p>The current branch</p>
</li>
<li><p>The latest commit on that branch</p>
</li>
</ul>
<p>Think of it as:</p>
<blockquote>
<p>“You are here 📍”</p>
</blockquote>
<hr />
<h3 id="heading-3-index-the-staging-area">3. <code>index</code> – The Staging Area</h3>
<p>The <code>index</code> file represents:</p>
<ul>
<li>What will go into the <strong>next commit</strong></li>
</ul>
<p>This is why staging exists.</p>
<hr />
<h2 id="heading-git-objects-the-building-blocks">Git Objects: The Building Blocks 🧱</h2>
<p>Git stores data using <strong>four object types</strong>, but three are core:</p>
<ol>
<li><p><strong>Blob</strong></p>
</li>
<li><p><strong>Tree</strong></p>
</li>
<li><p><strong>Commit</strong></p>
</li>
</ol>
<p>Let’s break them down.</p>
<hr />
<h2 id="heading-1-blob-file-content">1. Blob (File Content)</h2>
<p>A <strong>blob</strong> stores:</p>
<ul>
<li><p>File content only</p>
</li>
<li><p>No filename</p>
</li>
<li><p>No directory info</p>
</li>
</ul>
<p>Example:</p>
<pre><code class="lang-plaintext">"Hello Git"
</code></pre>
<p>That text becomes a <strong>blob object</strong>.</p>
<p>💡 If two files have the same content → Git stores <strong>only one blob</strong>.</p>
<hr />
<h2 id="heading-2-tree-folder-structure">2. Tree (Folder Structure)</h2>
<p>A <strong>tree</strong> represents:</p>
<ul>
<li><p>A directory</p>
</li>
<li><p>Filenames</p>
</li>
<li><p>File permissions</p>
</li>
<li><p>Links to blobs or other trees</p>
</li>
</ul>
<p>Think of a tree as:</p>
<blockquote>
<p>A folder pointing to files and subfolders</p>
</blockquote>
<hr />
<h2 id="heading-3-commit-snapshot-metadata">3. Commit (Snapshot + Metadata)</h2>
<p>A <strong>commit</strong> stores:</p>
<ul>
<li><p>A reference to a <strong>tree</strong></p>
</li>
<li><p>Parent commit(s)</p>
</li>
<li><p>Author info</p>
</li>
<li><p>Timestamp</p>
</li>
<li><p>Commit message</p>
</li>
</ul>
<p>A commit does <strong>not</strong> store files directly.</p>
<hr />
<h2 id="heading-relationship-between-commit-tree-and-blob">Relationship Between Commit, Tree, and Blob</h2>
<p><img src="https://julianogtz.github.io/my-personal-blog/static/ef7bc30d35466f4037e9fd821d6e7efe/5a190/git-database-flow.png" alt="https://julianogtz.github.io/my-personal-blog/static/ef7bc30d35466f4037e9fd821d6e7efe/5a190/git-database-flow.png" /></p>
<p><img src="https://hamwaves.com/collaboration/doc/rypress.com/images/12-4.png" alt="https://hamwaves.com/collaboration/doc/rypress.com/images/12-4.png" /></p>
<pre><code class="lang-plaintext">Commit
  ↓
 Tree
  ↓
Blobs (file contents)
</code></pre>
<p>This structure makes Git fast, efficient, and reliable.</p>
<hr />
<h2 id="heading-how-git-tracks-changes-not-diffs">How Git Tracks Changes (Not Diffs!)</h2>
<p>Here’s a key idea:</p>
<p>🚫 Git does <strong>not</strong> primarily store diffs<br />✅ Git stores <strong>snapshots</strong></p>
<p>Each commit:</p>
<ul>
<li><p>Points to a full snapshot of the project</p>
</li>
<li><p>Reuses unchanged objects from previous commits</p>
</li>
</ul>
<p>That’s why Git is fast and space-efficient.</p>
<hr />
<h2 id="heading-what-happens-internally-during-git-add">What Happens Internally During <code>git add</code>?</h2>
<p><img src="https://miro.medium.com/v2/resize%3Afit%3A1400/1%2Au5kWY00Tshc76QCPOjPufA.png" alt="https://miro.medium.com/v2/resize%3Afit%3A1400/1%2Au5kWY00Tshc76QCPOjPufA.png" /></p>
<p><img src="https://miro.medium.com/v2/resize%3Afit%3A1400/1%2AMLeAPktNiNWa1FnkE5-h1w.png" alt="https://miro.medium.com/v2/resize%3Afit%3A1400/1%2AMLeAPktNiNWa1FnkE5-h1w.png" /></p>
<p>When you run:</p>
<pre><code class="lang-plaintext">git add file.txt
</code></pre>
<p>Git does the following:</p>
<ol>
<li><p>Reads file content</p>
</li>
<li><p>Creates a <strong>blob object</strong></p>
</li>
<li><p>Stores it in <code>.git/objects</code></p>
</li>
<li><p>Updates the <strong>index (staging area)</strong></p>
</li>
</ol>
<p>👉 No commit yet<br />👉 Just preparation</p>
<hr />
<h2 id="heading-what-happens-internally-during-git-commit">What Happens Internally During <code>git commit</code>?</h2>
<p><img src="https://miro.medium.com/1%2ALa9tFzHMf2OIhzyhIcs20Q.png" alt="https://miro.medium.com/1%2ALa9tFzHMf2OIhzyhIcs20Q.png" /></p>
<p><img src="https://miro.medium.com/v2/1%2Al3ajqm6cHXkRpTVUlkiXSw.gif" alt="https://miro.medium.com/v2/1%2Al3ajqm6cHXkRpTVUlkiXSw.gif" /></p>
<p>When you run:</p>
<pre><code class="lang-plaintext">git commit -m "Add file"
</code></pre>
<p>Git:</p>
<ol>
<li><p>Reads the staging area (<code>index</code>)</p>
</li>
<li><p>Creates a <strong>tree object</strong></p>
</li>
<li><p>Creates a <strong>commit object</strong></p>
</li>
<li><p>Moves <code>HEAD</code> to the new commit</p>
</li>
</ol>
<p>🎉 Your snapshot is now permanent.</p>
<hr />
<h2 id="heading-how-git-uses-hashes-integrity-amp-safety">How Git Uses Hashes (Integrity &amp; Safety)</h2>
<p>Every Git object is identified by a <strong>SHA-1 hash</strong>.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">e83c5163316f89bfbde7d9ab23ca2e25604af290
</code></pre>
<p>This hash is based on:</p>
<ul>
<li><p>Object content</p>
</li>
<li><p>Object type</p>
</li>
</ul>
<h3 id="heading-why-this-matters">Why This Matters</h3>
<ul>
<li><p>Change the content → hash changes</p>
</li>
<li><p>Corruption is instantly detectable</p>
</li>
<li><p>History cannot be silently altered</p>
</li>
</ul>
<p>Git is <strong>self-verifying by design</strong>.</p>
<hr />
<h2 id="heading-the-mental-model-to-remember">The Mental Model to Remember 🧠</h2>
<p>Instead of memorizing commands, remember this:</p>
<ul>
<li><p>Git stores <strong>objects</strong></p>
</li>
<li><p>Objects are connected by <strong>hashes</strong></p>
</li>
<li><p>Commits point to trees</p>
</li>
<li><p>Trees point to blobs</p>
</li>
<li><p><code>git add</code> prepares</p>
</li>
<li><p><code>git commit</code> records</p>
</li>
</ul>
<p>Once this clicks, Git feels logical — not magical.</p>
]]></content:encoded></item><item><title><![CDATA[Git for Beginners: A Simple Guide to Version Control]]></title><description><![CDATA[If you’re starting your developer journey, one of the first tools you’ll hear about is Git.Git helps you track changes in your code, collaborate with others, and safely experiment without fear of losing work.
This article explains what Git is, why it...]]></description><link>https://nishutechdiary.com/git-for-beginners-a-simple-guide-to-version-control</link><guid isPermaLink="true">https://nishutechdiary.com/git-for-beginners-a-simple-guide-to-version-control</guid><dc:creator><![CDATA[Nishu Singh]]></dc:creator><pubDate>Fri, 16 Jan 2026 09:26:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/3GZNPBLImWc/upload/5fce8e55b8c0313674486dbe9f9b9347.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you’re starting your developer journey, one of the first tools you’ll hear about is <strong>Git</strong>.<br />Git helps you track changes in your code, collaborate with others, and safely experiment without fear of losing work.</p>
<p>This article explains <strong>what Git is</strong>, <strong>why it’s used</strong>, and <strong>how to use it step by step</strong>, even if you’re completely new.</p>
<hr />
<h2 id="heading-what-is-git">What is Git?</h2>
<p>Git is a <strong>distributed version control system</strong>.</p>
<p>In simple terms:</p>
<ul>
<li><p>It <strong>tracks changes</strong> in your files</p>
</li>
<li><p>It lets you <strong>save versions</strong> of your project</p>
</li>
<li><p>It allows <strong>multiple developers</strong> to work on the same code without conflicts</p>
</li>
</ul>
<p>Unlike older systems, Git gives <strong>every developer a full copy of the project history</strong> on their own machine.</p>
<hr />
<h2 id="heading-why-is-git-used">Why is Git Used?</h2>
<p>Git is used because it helps developers:</p>
<ul>
<li><p>✅ Track who changed what and when</p>
</li>
<li><p>✅ Roll back to earlier versions if something breaks</p>
</li>
<li><p>✅ Work on features without affecting the main code</p>
</li>
<li><p>✅ Collaborate efficiently with teams</p>
</li>
<li><p>✅ Maintain a clean and reliable project history</p>
</li>
</ul>
<p>Whether you’re working solo or in a team, Git is essential.</p>
<hr />
<h2 id="heading-git-basics-amp-core-terminologies">Git Basics &amp; Core Terminologies</h2>
<p>Before running commands, let’s understand some key Git concepts.</p>
<h3 id="heading-repository-repo">Repository (Repo)</h3>
<p>A <strong>repository</strong> is a project folder that Git is tracking.</p>
<p>It contains:</p>
<ul>
<li><p>Your project files</p>
</li>
<li><p>A hidden <code>.git</code> directory that stores history and metadata</p>
</li>
</ul>
<hr />
<h3 id="heading-commit">Commit</h3>
<p>A <strong>commit</strong> is a snapshot of your project at a specific point in time.</p>
<p>Think of it like:</p>
<blockquote>
<p>“Save game” 🎮 for your code</p>
</blockquote>
<p>Each commit has:</p>
<ul>
<li><p>A unique ID (hash)</p>
</li>
<li><p>A message describing the change</p>
</li>
</ul>
<hr />
<h3 id="heading-branch">Branch</h3>
<p>A <strong>branch</strong> lets you work on features independently.</p>
<ul>
<li><p><code>main</code> (or <code>master</code>) → stable code</p>
</li>
<li><p>feature branches → experiments or new features</p>
</li>
</ul>
<hr />
<h3 id="heading-head">HEAD</h3>
<p><code>HEAD</code> is a pointer to the <strong>current commit you’re working on</strong>.</p>
<p>Usually, it points to the latest commit on the current branch.</p>
<p><img src="https://miro.medium.com/1%2AdiRLm1S5hkVoh5qeArND0Q.png" alt="https://miro.medium.com/1%2AdiRLm1S5hkVoh5qeArND0Q.png" /></p>
<p>Git works in <strong>three main areas</strong>:</p>
<ol>
<li><p><strong>Working Directory</strong> – where you edit files</p>
</li>
<li><p><strong>Staging Area</strong> – where you prepare files for commit</p>
</li>
<li><p><strong>Repository</strong> – where commits are permanently stored</p>
</li>
</ol>
<hr />
<h2 id="heading-common-git-commands-with-examples">Common Git Commands (With Examples)</h2>
<p>Let’s see the most important Git commands used daily.</p>
<h3 id="heading-1-git-init">1. <code>git init</code></h3>
<p>Creates a new Git repository.</p>
<pre><code class="lang-plaintext">git init
</code></pre>
<p>Use this inside your project folder.</p>
<hr />
<h3 id="heading-2-git-status">2. <code>git status</code></h3>
<p>Shows the current state of your files.</p>
<pre><code class="lang-plaintext">git status
</code></pre>
<p>It tells you:</p>
<ul>
<li><p>Which files are modified</p>
</li>
<li><p>Which files are staged</p>
</li>
<li><p>What’s not tracked yet</p>
</li>
</ul>
<hr />
<h3 id="heading-3-git-add">3. <code>git add</code></h3>
<p>Moves changes to the staging area.</p>
<pre><code class="lang-plaintext">git add file.txt
</code></pre>
<p>Or add everything:</p>
<pre><code class="lang-plaintext">git add .
</code></pre>
<hr />
<h3 id="heading-4-git-commit">4. <code>git commit</code></h3>
<p>Saves staged changes to the repository.</p>
<pre><code class="lang-plaintext">git commit -m "Add initial project files"
</code></pre>
<p>💡 Always write clear commit messages.</p>
<hr />
<h3 id="heading-5-git-log">5. <code>git log</code></h3>
<p>Shows the commit history.</p>
<pre><code class="lang-plaintext">git log
</code></pre>
<p>You’ll see:</p>
<ul>
<li><p>Commit IDs</p>
</li>
<li><p>Author</p>
</li>
<li><p>Date</p>
</li>
<li><p>Commit message</p>
</li>
</ul>
<p><img src="https://user-images.githubusercontent.com/44003176/103466403-36a81780-4d45-11eb-90cc-167d210d7a52.png" alt="https://user-images.githubusercontent.com/44003176/103466403-36a81780-4d45-11eb-90cc-167d210d7a52.png" /></p>
<p><img src="https://images.openai.com/thumbnails/url/GObS43icu5mZUVJSUGylr5-al1xUWVCSmqJbkpRnoJdeXJJYkpmsl5yfq5-Zm5ieWmxfaAuUsXL0S7F0Tw7yqoxIcnNPTwwoic8rKXGLLzdzyqgs8TPzMCyI8vcvDw2pMi4tSPPLCUoO9c80DixXKwYAdisnAA" alt="https://i.sstatic.net/Hg5bt.png" /></p>
<hr />
<h3 id="heading-6-git-branch">6. <code>git branch</code></h3>
<p>Lists or creates branches.</p>
<pre><code class="lang-plaintext">git branch
</code></pre>
<p>Create a new branch:</p>
<pre><code class="lang-plaintext">git branch feature-login
</code></pre>
<hr />
<h3 id="heading-7-git-checkout">7. <code>git checkout</code></h3>
<p>Switch between branches.</p>
<pre><code class="lang-plaintext">git checkout feature-login
</code></pre>
<p>(Modern alternative: <code>git switch</code>)</p>
<h2 id="heading-a-simple-git-workflow-from-scratch">A Simple Git Workflow (From Scratch)</h2>
<p><img src="https://humbletoolsmith.com/img/posts/a-look-inside-the-_git-folder/Git%20Folder%20Internals.png" alt="https://humbletoolsmith.com/img/posts/a-look-inside-the-_git-folder/Git%20Folder%20Internals.png" /></p>
<p><img src="https://nevrenato.github.io/CSAIL_Git/images/git_workflow.png" alt="https://nevrenato.github.io/CSAIL_Git/images/git_workflow.png" /></p>
<p>Let’s walk through a basic developer workflow.</p>
<pre><code class="lang-plaintext">mkdir my-project
cd my-project
git init
</code></pre>
<p>Create a file:</p>
<pre><code class="lang-plaintext">echo "Hello Git" &gt; readme.txt
</code></pre>
<p>Check status:</p>
<pre><code class="lang-plaintext">git status
</code></pre>
<p>Stage the file:</p>
<pre><code class="lang-plaintext">git add readme.txt
</code></pre>
<p>Commit:</p>
<pre><code class="lang-plaintext">git commit -m "Add readme file"
</code></pre>
<p>Check history:</p>
<pre><code class="lang-plaintext">git log
</code></pre>
<p>🎉 You’ve successfully used Git!</p>
]]></content:encoded></item></channel></rss>