<?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[Sukanta's Blog]]></title><description><![CDATA[Sukanta's Blog]]></description><link>https://blog.sukanta.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Apr 2026 10:28:30 GMT</lastBuildDate><atom:link href="https://blog.sukanta.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How DNS Resolution Works]]></title><description><![CDATA[Every time you type sukanta.dev into your browser to see my cool portfolio, a fascinating chain of events flows behind the scenes. Our computers, as a node in the network, does not know what sukanta.dev, chaicode.com or google.com actually means. It ...]]></description><link>https://blog.sukanta.dev/dns-resolution-how</link><guid isPermaLink="true">https://blog.sukanta.dev/dns-resolution-how</guid><category><![CDATA[dns]]></category><category><![CDATA[dns server]]></category><category><![CDATA[#DNS Resolution]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Sukanta Bala]]></dc:creator><pubDate>Sat, 31 Jan 2026 17:02:32 GMT</pubDate><content:encoded><![CDATA[<p>Every time you type <code>sukanta.dev</code> into your browser to see my cool portfolio, a fascinating chain of events flows behind the scenes. Our computers, as a node in the network, does not know what <code>sukanta.dev</code>, <code>chaicode.com</code> or <code>google.com</code> actually means. It can only connect with other computers using its IP address only, which looks like <strong>142.240.169.46</strong>. So</p>
<p>The <strong>D</strong>omain <strong>N</strong>ame <strong>S</strong>ystem (DNS) what bridges this gap, acting as the internet's phonebook by translating human-readable domain names into machine-readable IP addresses.</p>
<p>But how does this translation actually happen? Let's explore DNS resolution from the ground up using <code>dig</code>, a powerful diagnostic tool that lets us peek inside this process.</p>
<h2 id="heading-what-is-dns-and-why-does-name-resolution-exist">What is DNS and Why Does Name Resolution Exist?</h2>
<p>Imagine if you had to remember <code>142.250.185.46</code> instead of "<a target="_blank" href="http://google.com">google.com</a>" for every website you visit. The internet would be nearly impossible to use. DNS exists to solve this fundamental problem: computers need numerical IP addresses to route traffic, but humans prefer memorable names.</p>
<p>DNS is a hierarchical, distributed database system that maps domain names to IP addresses. When you request a website, your computer needs to resolve that domain name through DNS before it can establish a connection. This resolution process happens so quickly (typically under 100 milliseconds) that you rarely notice it, but understanding how it works reveals the elegant architecture underlying the internet.</p>
<h2 id="heading-the-dig-command-your-dns-inspection-tool">The dig Command: Your DNS Inspection Tool</h2>
<p>The <code>dig</code> (Domain Information Groper) command is a flexible DNS lookup utility available on most Unix-like systems. While tools like <code>nslookup</code> exist, <code>dig</code> provides more detailed output and greater control, making it the preferred choice for network administrators and developers.</p>
<p>Basic syntax is straightforward:</p>
<pre><code class="lang-bash">dig sukanta.dev
</code></pre>
<p>This command queries DNS servers to resolve "<a target="_blank" href="http://example.com">example.com</a>" and returns detailed information about the resolution process. But <code>dig</code> can do much more, it can query specific record types, target specific nameservers, and reveal the hierarchical structure of DNS itself.</p>
<h2 id="heading-understanding-dns-hierarchy-root-nameservers">Understanding DNS Hierarchy: Root Nameservers</h2>
<p>Let's start at the very top of the DNS hierarchy:</p>
<pre><code class="lang-bash">dig . NS
</code></pre>
<p>The dot (<code>.</code>) represents the root of the DNS hierarchy, and <code>NS</code> requests nameserver records. When you run this command, you'll see something like:</p>
<pre><code class="lang-bash">.                    518400  IN  NS  a.root-servers.net.
.                    518400  IN  NS  b.root-servers.net.
.                    518400  IN  NS  c.root-servers.net.
...
</code></pre>
<p>There are 13 root nameserver identities (<a target="_blank" href="http://a.root-servers.net">a.root-servers.net</a> through <a target="_blank" href="http://m.root-servers.net">m.root-servers.net</a>), though each is backed by many physical servers distributed globally using anycast routing. These root servers are the starting point for all DNS resolution.</p>
<p><strong>What do root nameservers do?</strong> They don't know the IP address of <a target="_blank" href="http://google.com">google.com</a>, but they know who does: they can direct you to the nameservers responsible for top-level domains (TLDs) like .com, .org, or .net.</p>
<p>Think of root nameservers as the reception desk at a massive organization. They don't have every employee's direct extension, but they know which department to send you to.</p>
<h2 id="heading-top-level-domain-nameservers">Top-Level Domain Nameservers</h2>
<p>Let's move down one level:</p>
<pre><code class="lang-bash">dig com NS
</code></pre>
<p>This queries for the nameservers responsible for the <code>.com</code> TLD. You'll see output like:</p>
<pre><code class="lang-bash">com.                 172800  IN  NS  a.gtld-servers.net.
com.                 172800  IN  NS  b.gtld-servers.net.
com.                 172800  IN  NS  c.gtld-servers.net.
...
</code></pre>
<p>The <code>.com</code> TLD nameservers (operated by Verisign) manage information about all domains ending in .com. There are millions of .com domains, but these servers don't store all their records directly. Instead, they know which authoritative nameservers are responsible for each specific domain.</p>
<p><strong>The delegation model:</strong> Root servers delegate to TLD servers, which in turn delegate to authoritative nameservers. This hierarchical delegation is what makes DNS scalable enough to handle billions of domains.</p>
<h2 id="heading-authoritative-nameservers-the-final-authority">Authoritative Nameservers: The Final Authority</h2>
<p>Now let's find who actually knows about <a target="_blank" href="http://google.com">google.com</a>:</p>
<pre><code class="lang-bash">dig google.com NS
</code></pre>
<p>This returns:</p>
<pre><code class="lang-bash">google.com.          21600   IN  NS  ns1.google.com.
google.com.          21600   IN  NS  ns2.google.com.
google.com.          21600   IN  NS  ns3.google.com.
google.com.          21600   IN  NS  ns4.google.com.
</code></pre>
<p>These are Google's authoritative nameservers, the servers that hold the definitive DNS records for <a target="_blank" href="http://google.com">google.com</a>. When you register a domain, you specify which nameservers have authority over it. These servers are the single source of truth for that domain's DNS records.</p>
<p><strong>NS records matter</strong> because they establish the chain of authority. Each level of the DNS hierarchy uses NS records to point to the next level, creating a clear path from root to your desired domain.</p>
<h2 id="heading-the-complete-dns-resolution-flow">The Complete DNS Resolution Flow</h2>
<p>Now let's see the full process in action:</p>
<pre><code class="lang-bash">dig google.com
</code></pre>
<p>The output shows the actual IP address resolution:</p>
<pre><code class="lang-bash">google.com.          300     IN  A   142.250.185.46
</code></pre>
<p>But what happened behind the scenes? When your recursive resolver (typically provided by your ISP or a service like 8.8.8.8) received this query, it followed this path:</p>
<ol>
<li><p><strong>Query root nameserver:</strong> "Where can I find information about .com domains?"</p>
<ul>
<li>Root responds: "Ask the .com TLD nameservers"</li>
</ul>
</li>
<li><p><strong>Query TLD nameserver:</strong> "Where can I find information about <a target="_blank" href="http://google.com">google.com</a>?"</p>
<ul>
<li>TLD responds: "Ask <a target="_blank" href="http://ns1.google.com">ns1.google.com</a> (and its siblings)"</li>
</ul>
</li>
<li><p><strong>Query authoritative nameserver:</strong> "What's the IP address for <a target="_blank" href="http://google.com">google.com</a>?"</p>
<ul>
<li>Authoritative server responds: "142.250.185.46"</li>
</ul>
</li>
</ol>
<p>This entire process happens recursively, meaning your local DNS resolver handles all these queries on your behalf. You just asked for <a target="_blank" href="http://google.com">google.com</a> once, but your resolver made multiple queries to different servers in the hierarchy.</p>
<h2 id="heading-caching-the-unsung-hero">Caching: The Unsung Hero</h2>
<p>Notice the numbers before <code>IN</code> in dig output (like <code>300</code> or <code>21600</code>)? These are TTL (Time To Live) values in seconds. They tell resolvers how long they can cache this response before querying again.</p>
<p>Caching dramatically improves DNS performance. Without it, every DNS query would require traversing the entire hierarchy. With caching, frequently accessed domains resolve almost instantly from your local resolver's cache.</p>
<p>The dig output includes a "Query time" field showing how long the lookup took. Cached responses return in single-digit milliseconds, while uncached queries might take 50-100ms as they traverse the hierarchy.</p>
<h2 id="heading-connecting-to-real-world-browser-requests">Connecting to Real-World Browser Requests</h2>
<p>When you type "<a target="_blank" href="http://google.com">google.com</a>" into your browser:</p>
<ol>
<li><p>Browser checks its own DNS cache</p>
</li>
<li><p>Operating system checks its DNS cache</p>
</li>
<li><p>OS queries configured recursive resolver</p>
</li>
<li><p>Resolver checks its cache, or performs recursive resolution</p>
</li>
<li><p>IP address returns to browser</p>
</li>
<li><p>Browser initiates TCP connection to that IP</p>
</li>
<li><p>HTTPS handshake and page load begin</p>
</li>
</ol>
<p>All of this happens before you see a single pixel of content. DNS resolution is the critical first step that makes the web usable.</p>
<h2 id="heading-practical-takeaways">Practical Takeaways</h2>
<p>Understanding DNS resolution helps you:</p>
<ul>
<li><p><strong>Debug connectivity issues:</strong> Is DNS resolution failing, or is the server down?</p>
</li>
<li><p><strong>Optimize performance:</strong> Lower TTLs for frequently changing records, higher for stable ones</p>
</li>
<li><p><strong>Design resilient systems:</strong> Multiple nameservers provide redundancy</p>
</li>
<li><p><strong>Understand internet architecture:</strong> DNS is foundational infrastructure</p>
</li>
</ul>
<p>The <code>dig</code> command transforms DNS from a mysterious black box into a transparent, inspectable system. Next time your website seems slow or unreachable, start with <code>dig</code>—it might just reveal where the problem lies.</p>
<p>The hierarchical elegance of DNS, with its clear delegation model and distributed architecture, is a testament to brilliant systems design. It scales globally, handles billions of queries per day, and remains one of the internet's most critical and resilient services.</p>
]]></content:encoded></item><item><title><![CDATA[DNS Record Types explained to a Hooman]]></title><description><![CDATA[Routers get DNS record and work according to them very well, them fancy telephone directories. But we are not routers, we’re Hoomans (it’s Humans).
This article is your go-to if you are new to domains, hosting, starting an agency, or creating your ow...]]></description><link>https://blog.sukanta.dev/dns-record-types</link><guid isPermaLink="true">https://blog.sukanta.dev/dns-record-types</guid><category><![CDATA[dns]]></category><category><![CDATA[dns-records]]></category><category><![CDATA[dns server]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Sukanta Bala]]></dc:creator><pubDate>Fri, 30 Jan 2026 15:25:46 GMT</pubDate><content:encoded><![CDATA[<p>Routers get DNS record and work according to them very well, them fancy telephone directories. But we are not routers, we’re Hoomans (it’s Humans).</p>
<p>This article is your go-to if you are new to domains, hosting, starting an agency, or creating your own little world to show to the REAL world. Because you got to know, how your website is managed over the servers of the Internet.</p>
<h2 id="heading-what-is-dns">What is DNS?</h2>
<p>DNS, or Domain Name System, is the telephone directory of the Internet.</p>
<p>We hoomans are good at remembering names like <code>google.com</code>, <code>amazon.in</code>, <code>sukanta.dev</code>.</p>
<p>and computers only good at understanding their corresponding server addresses, which is an IP address which looks like this:</p>
<pre><code class="lang-bash">142.250.183.14
</code></pre>
<p>Hoomans, store our friends fam and professional contacts associated with names inside our phone. But how to store our website names associated with their server addresses like that, and who will store it?</p>
<p>DNS is the solution, it is a system that translates human-friendly names into computer-friendly addresses.</p>
<p>And there are DNS servers placed all over the world to store that website to server records, like a telephone directory.</p>
<p>So when we type <code>chaicode.com</code> to our browser, our computer asks the DNS:</p>
<blockquote>
<p>Hey, I have this name. Whose name is it?</p>
</blockquote>
<p>DNS replies with an address, there are several steps involved, but all those discussed in my other article, but check after you finish reading this.</p>
<h2 id="heading-why-dns-are-needed">Why DNS are needed?</h2>
<p>You should not have this question after reading the previous section. But some of you will have it, so here we are.</p>
<p>DNS is not one big database with one answer per domain. That would be too simple and too fragile.</p>
<p>Instead, DNS stores records. Each record answers a specific question:</p>
<ul>
<li><p>Who is responsible for this domain?</p>
</li>
<li><p>Which server hosts the website?</p>
</li>
<li><p>Where should emails be delivered?</p>
</li>
<li><p>Is this domain allowed to send email?</p>
</li>
<li><p>Is this domain owned by this service?</p>
</li>
</ul>
<p>Each DNS record is a rule or fact about a domain.</p>
<p>Think of DNS records as index cards in a filing cabinet. One card says <em>who’s in charge</em>, another says <em>where the website lives</em>, another says <em>where emails go</em>. Together, they describe how the domain behaves on the internet.</p>
<h2 id="heading-ns-record-who-is-responsible-for-a-domain">NS Record (who is responsible for a domain)</h2>
<p>NS (Nameserver) record answers this simple question:</p>
<blockquote>
<p>Who is in charge here?</p>
</blockquote>
<p>In other words, Which DNS servers are authoritative for this domain?</p>
<p>When the internet looks up <code>chaicode.com</code>, it eventually reaches a point where it must ask:</p>
<blockquote>
<p>Which servers are allowed to answer questions about this domain?</p>
</blockquote>
<p>The NS record provides that answer.</p>
<pre><code class="lang-bash">chaicode.com -&gt; ns1.cloudflare.com
</code></pre>
<p>This tells the world:</p>
<blockquote>
<p>If you want the truth about chaicode.com, ask Cloudflare’s name servers.</p>
</blockquote>
<p>There are several nameservers other than cloudflare, but it is one of the largest of ‘em.</p>
<p>Without NS records, DNS would be chaos. Everyone would answer differently, and nothing would be trustworthy.</p>
<h2 id="heading-a-record-domain-server-ipv4-address">A Record (Domain → Server IPv4 Address)</h2>
<p>A stands for Address. An A record maps:</p>
<pre><code class="lang-bash">chaicode.com (domain name) -&gt; 141.169.2.6 (IPv4 address)
</code></pre>
<p>This is the most basic and important DNS record for websites.</p>
<p>When you visit a site, the browser usually ends up asking:</p>
<blockquote>
<p>What IP address should I connect to?</p>
</blockquote>
<p>The A record gives the answer.</p>
<p>If your website doesn’t load, nine times out of ten, something is wrong with the A record.</p>
<h2 id="heading-aaaa-record-domain-server-ipv6-address">AAAA Record (Domain → Server IPv6 Address)</h2>
<p>AAAA is not a typo. It’s four A’s because IPv6 addresses are much larger.</p>
<p>An <strong>AAAA record</strong> maps:</p>
<pre><code class="lang-bash">chaicode.com (domain name) -&gt; (2606:2800:220:1:248:1893:25c8:1946) IPv6 address
</code></pre>
<p>Why does this exist?</p>
<p>Because the internet is running out of IPv4 addresses. IPv6 is the long-term solution.</p>
<p>Modern systems prefer IPv6 when available. If both A and AAAA records exist, the client usually tries IPv6 first, then falls back to IPv4.</p>
<p>You don’t <em>need</em> AAAA records, but the future definitely does.</p>
<h2 id="heading-cname-record-domain-pointing-another-domain">CNAME Record (Domain pointing another Domain)</h2>
<p><strong>CNAME</strong> stands for <strong>Canonical Name</strong>.</p>
<p>A CNAME record does <strong>not</strong> point to an IP address.<br />It points to <strong>another domain name</strong>.</p>
<p>Example:</p>
<pre><code class="lang-bash">www.sukanta.dev -&gt; sukanta.dev
</code></pre>
<p>This means:</p>
<blockquote>
<p>“www.sukanta.dev is just another name for sukanta.dev”</p>
</blockquote>
<p>Why is this useful?</p>
<p>Because it avoids duplication. If the IP address changes, you update it in one place, and all CNAMEs follow automatically.</p>
<p>Common use cases:</p>
<ul>
<li><p><code>www</code> pointing to the root domain</p>
</li>
<li><p>Subdomains pointing to SaaS platforms</p>
</li>
<li><p>Aliases for services you don’t control directly</p>
</li>
</ul>
<p>One important rule:<br />A CNAME <strong>cannot</strong> coexist with other records at the same name. It replaces them.</p>
<h2 id="heading-mx-record-emails-finding-your-mail-server">MX Record (Emails finding your Mail Server)</h2>
<p><strong>MX</strong> stands for <strong>Mail Exchange</strong>.</p>
<p>MX records answer this question:</p>
<blockquote>
<p>“Where should emails for this domain be delivered?”</p>
</blockquote>
<p>Example:</p>
<pre><code class="lang-bash">sukanta.dev -&gt; mail1.google.com (priority 10)
sukanta.dev -&gt; mail2.google.com (priority 20)
</code></pre>
<p>When someone sends an email to <a target="_blank" href="mailto:hello@example.com"><code>contact@sukanta.com</code></a>, the sending mail server:</p>
<ol>
<li><p>Looks up the MX records</p>
</li>
<li><p>Tries the lowest priority number first</p>
</li>
<li><p>Falls back if that server is unavailable</p>
</li>
</ol>
<p>MX records make email resilient. If one mail server is down, another can take over.</p>
<p>No MX record means <strong>no email delivery</strong>, even if your website works perfectly.</p>
<h2 id="heading-txt-record-extra-info-and-verification">TXT Record (Extra Info and Verification)</h2>
<p><strong>TXT</strong> records store <strong>arbitrary text</strong>.</p>
<p>Originally, they were meant for notes. Today, they are one of the most powerful DNS record types.</p>
<p>TXT records are commonly used for:</p>
<ul>
<li><p>Domain ownership verification</p>
</li>
<li><p>Email authentication (SPF, DKIM, DMARC)</p>
</li>
<li><p>Security policies</p>
</li>
<li><p>Service configuration</p>
</li>
</ul>
<p>Example:</p>
<pre><code class="lang-bash">sukanta.dev -&gt; <span class="hljs-string">"v=spf1 include:_spf.google.com ~all"</span>
</code></pre>
<p>This tells the world:</p>
<blockquote>
<p>“These servers are allowed to send email on behalf of this domain.”</p>
</blockquote>
<p>TXT records are how services confirm:</p>
<blockquote>
<p>“Yes, you actually own this domain.”</p>
</blockquote>
<p>They look boring. They are not.</p>
<h2 id="heading-all-dns-records-working-together">All DNS Records Working together</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769786722548/851d84c9-c580-4f0e-b914-f4b5a7f6549b.png" alt class="image--center mx-auto" /></p>
<p>Let’s walk through what happens when someone:</p>
<ul>
<li><p>Visits your website</p>
</li>
<li><p>Sends you an email</p>
</li>
</ul>
<h3 id="heading-visiting-your-website">Visiting your website</h3>
<ol>
<li><p>The browser asks DNS who is responsible → <strong>NS record</strong></p>
</li>
<li><p>It asks the authoritative server for the IP → <strong>A / AAAA record</strong></p>
</li>
<li><p>If using <code>www</code>, DNS follows the alias → <strong>CNAME</strong></p>
</li>
<li><p>The browser connects to the IP address</p>
</li>
<li><p>The website loads</p>
</li>
</ol>
<p>All of this happens in milliseconds.</p>
<h3 id="heading-sending-you-an-email">Sending you an email</h3>
<ol>
<li><p>The sender’s mail server looks up <strong>MX records</strong></p>
</li>
<li><p>It connects to the correct mail server</p>
</li>
<li><p>It checks <strong>TXT records</strong> to verify legitimacy</p>
</li>
<li><p>The email is accepted (or rejected)</p>
</li>
</ol>
<p>Different records. Same system. One coordinated dance.</p>
<h2 id="heading-the-big-picture-not-big-boss">The Big Picture (not Big Boss)</h2>
<p>DNS is not magic. It’s structured, layered, and surprisingly elegant.</p>
<p>Each record type does <strong>one job</strong>, but together they answer a bigger question:</p>
<blockquote>
<p>“How does this domain behave on the internet?”</p>
</blockquote>
<p>Once you understand DNS records, a lot of things suddenly make sense:</p>
<ul>
<li><p>Why websites fail after “just one small change”</p>
</li>
<li><p>Why email setups are fragile</p>
</li>
<li><p>Why DNS changes take time to propagate</p>
</li>
</ul>
<p>DNS is slow on purpose, boring by design, and absolutely foundational.</p>
<p>The internet rests on it; quietly, constantly, and without asking for credit.</p>
]]></content:encoded></item><item><title><![CDATA[Inside Git]]></title><description><![CDATA[If you clicked this blog, AI is not gonna replace you. You want to wander in depth. Want to know when you run git add or git commit ? Let’s peek behind the curtain and explore the secret world inside .git directory.
What is .git, Anyway?
When you exe...]]></description><link>https://blog.sukanta.dev/inside-git</link><guid isPermaLink="true">https://blog.sukanta.dev/inside-git</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[vcs]]></category><dc:creator><![CDATA[Sukanta Bala]]></dc:creator><pubDate>Sat, 17 Jan 2026 15:06:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768662076127/3e2c0418-2b68-47d6-842d-a4b903c6b789.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you clicked this blog, AI is not gonna replace you. You want to wander in depth. Want to know when you run <code>git add</code> or <code>git commit</code> ? Let’s peek behind the curtain and explore the secret world inside .git directory.</p>
<h2 id="heading-what-is-git-anyway">What is .git, Anyway?</h2>
<p>When you execute <code>git init</code> in your project initially, Git creates a hidden <code>.git</code> directory inside the working directory.</p>
<p>Git is like a super-smart filing cabinet that remembers every version of every file you have ever committed. And the <code>.git</code> folder is where that filing cabinet lives.</p>
<p>Now <code>.git</code> is, like Git’s brain, almost all the git’s shenanigans happens here. Git operates as a content-addressable filesystem with a version control interface built on top of it.</p>
<h2 id="heading-inside-git">Inside .git</h2>
<p>After initializing a new repository, Git creates several key components:</p>
<ul>
<li><p><strong>HEAD : A reference to the current branch, like a bookmark.</strong></p>
</li>
<li><p><strong>objects/ : The directory, which is the actual database where Git stores all the files upon commits.</strong></p>
</li>
<li><p><strong>refs/ : Stores pointers to commits e.g. branches, tags etc.</strong></p>
</li>
<li><p><strong>config : Configuration directory containing Git settings specific to your project.</strong></p>
</li>
<li><p><strong>index : The staging area, where tracked files are stored. More of this is discussed later.</strong></p>
</li>
<li><p><strong>hooks/ : Scripts that run automatically on Git events.</strong></p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768661621308/406a319e-1f95-4d65-a8f6-c5861834f3d2.png" alt /></p>
<h2 id="heading-three-musketeers-blob-tree-and-commit">Three Musketeers: Blob, Tree and Commit</h2>
<p>Git uses three types of objects to track your project.</p>
<ol>
<li><p><strong>Blob</strong> : A blob stores the content of your files. Not filenames, not directory structures; just pure content. Think of blobs as actual “stuff”.</p>
</li>
<li><p><strong>Tree</strong> : Trees organize blobs by storing filenames and directory structures. A tree is like a directory that points to blobs (files) and other trees (sub-directories).</p>
</li>
<li><p><strong>Commit</strong> : A commit object references a tree and includes metadata like author, timestamp and parent commits. It is the snapshot of your entire project at a specific point in time.</p>
</li>
</ol>
<h2 id="heading-what-really-happens-during-git-add-and-git-commit">What Really happens during <code>git add</code> and <code>git commit</code> ?</h2>
<p>Let me dissect what happens to these commands you use everyday.</p>
<h3 id="heading-running-git-add">Running <code>git add</code></h3>
<ol>
<li><p>Git calculates a SHA-1 hash of your file’s content</p>
</li>
<li><p>The file is compressed and stored as a blob in the <code>objects</code> directory</p>
</li>
<li><p>Index (Staging area) is updated with a reference to this blob</p>
</li>
</ol>
<p>Git stores each object in a sub-directory named with the first two characters of its hash, with the remaining 38 characters as the filename.</p>
<h3 id="heading-running-git-commit">Running <code>git commit</code></h3>
<ol>
<li><p>Creates a tree object from the staging area</p>
</li>
<li><p>It creates a commit object pointing to that tree</p>
</li>
<li><p>The commit includes your message, author info and timestamp</p>
</li>
<li><p>Current branch pointer moves to this new commit</p>
</li>
</ol>
<p>Essentially, <code>git add</code> stores blobs for changed files and updates the index, while <code>git commit</code> creates tree and commit objects.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768661693668/5acfe995-d5f3-436c-b44b-b1926efbdad0.png" alt /></p>
<h2 id="heading-the-secret-sauce-sha-1-hashes">The Secret Sauce: SHA-1 Hashes</h2>
<p>Git uses SHA-1 hashes as unique identifiers for all objects. Every file, every commit gets a 40-character fingerprint like <code>b69cf9v9f8d9xcv9fdd9v8bf99vfuhrixo76f908</code>.</p>
<p>Why this matters?</p>
<p>Integrity. Even one-bit change changes the hash completely.</p>
<p>Identical files gets the same hash, enforcing deduplication.</p>
<p>git can quickly check if the content exists by looking up its hash.</p>
<h2 id="heading-summary-of-it">Summary of it</h2>
<p>In Git, everything is content-addressed, where files are stored by their content’s hash.</p>
<p>Each commit is a snapshot, not only diffs.</p>
<p>Branches just point to commits, making them lightweight and fast.</p>
<p>Git is basically a Directed Acyclic Graph (DAG), commits link to their parent commits.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Git is a content-addressable filesystem where blobs store file contents, trees store directory structures, and commits tie everything together with metadata. SHA-1 hashes ensure integrity, and the <code>.git</code> directory is where all this magic lives.</p>
]]></content:encoded></item><item><title><![CDATA[Why Version Control Exists]]></title><description><![CDATA[If you have done any kind of Software project in your life, you must have folders in your systems named like these:
project, project_modified, project_sam, project_latest, project_final
Then you already have some idea what this blog is about.
If you ...]]></description><link>https://blog.sukanta.dev/why-vcs</link><guid isPermaLink="true">https://blog.sukanta.dev/why-vcs</guid><category><![CDATA[vcs]]></category><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[development]]></category><category><![CDATA[Developer Tools]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Sukanta Bala]]></dc:creator><pubDate>Sat, 17 Jan 2026 11:25:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768647453483/4fdd5af8-af10-4966-9009-f44a137903df.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you have done any kind of Software project in your life, you must have folders in your systems named like these:</p>
<p><code>project</code>, <code>project_modified</code>, <code>project_sam</code>, <code>project_latest</code>, <code>project_final</code></p>
<p>Then you already have some idea what this blog is about.</p>
<p>If you did not get it, the next section is especially for you.</p>
<h2 id="heading-pendrive-one-man-army">Pendrive: One Man Army</h2>
<p>I learned about the importance of Version Control in a very early age.</p>
<p>Year 2009, my uncle was in his final year in BTech. He had a few pen-drives in his collection, of various sizes. Some of ‘em contained media, some had important project files. I remembered he had a friend with whom he used to share one of his pen-drive with. It was a fancy looking one, 16GB stick. He explicitly forbed to touch that pen-drive out of all.</p>
<p>So one day, I touched and took the pen-drive and went to a gaming parlor to “load” the new GTA IV to it.</p>
<p>The transfer started, after a while I got an error of insufficient storage. Now you get where this is going.</p>
<p>I saw a file named “BMS_final.zip”, and I deleted it. Thank God I did not know <code>shift + del</code> back then.</p>
<p>My uncle got back his project file inside the recycle bin of a random PC inside the game parlor, but that was not enough to stop myself from getting smacked.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768647595270/d1d7bb05-bfa3-419e-a2cb-9c8edde9df5d.png" alt /></p>
<p>This story highlighted a grave issue of using Pendrives, a single point of failure.</p>
<p>And I got to know the other issues when I had to use it myself.</p>
<p>Me and my team was building a website. Areej works on the homepage, copies her changes to a pendrive, and emails it to Ankit. Ankit makes his updates, but his pendrive corrupts. Meanwhile, Priyanshu has been working on the same files for two days, unaware that Areej already modified them. When Priyanshu finally shares his version, Areej’s changes vanish into the void.</p>
<p>The pendrive, like a baton in a relay race, hurt parallel programming.</p>
<p>An alternative approach was by mail, but it did not fix versioning problems.</p>
<p>The problems were endless. Someone would overwrite someone else's work. Critical changes would disappear. Nobody knew who changed what, when, or why. If you needed to revert to last week's working version? Good luck finding it among 47 folders named variations of "final."</p>
<h2 id="heading-collaboration-catastrophe">Collaboration Catastrophe</h2>
<p>The real nightmare began when multiple developers touched the same file.</p>
<p>Imagine three people editing a recipe simultaneously, each with their own copy. One adds salt, another removes sugar, and the third changes the oven temperature. When you try to combine their work, you end up with a recipe that's simultaneously too salty, missing sugar, and has conflicting cooking instructions.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768647610481/abdbd3b8-f78b-429c-bb38-e99e09e45fca.png" alt /></p>
<p>Developing software this way was just not inconvenient, it was counterproductive. Builds broke, bugs that resolved previously re-appeared in someone else’s overwrite, there was no history on who changed what, teams spent more time on managing files rather than actual development.</p>
<h2 id="heading-the-silent-guardian-version-control">The Silent Guardian: Version Control</h2>
<p>Version control systems emerged from this chaos as a fundamental answer: what if every change was tracked, every developer could work simultaneously, and you could travel back in time to any previous state of your code?</p>
<p>Modern Version Control Systems like Git became a watchful productivity protector and versioning moderator.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768648485121/e535ba9e-af93-44c1-a865-548073e98f2f.png" alt /></p>
<p>They track every changes, by a complete history of who, when, where and why.</p>
<p>They embrace collaboration where multiple developers can modify the same file without overwriting, or overwriting under developer’s sane control and supervision.</p>
<p>They provide instant rollback to a previous state if something breaks on the current state.</p>
<p>Code Reviews became easier than ever before merging a change into the main codebase.</p>
<h2 id="heading-vcs-is-not-optional">VCS is not optional</h2>
<p>Version Control is an integral part of Software Development. Even a solo developer uses it, because the real enemy is not other developers overwriting your code, it's forgetting what worked, losing track of changes, and having no safety net when things break.</p>
<p>Developers who are getting started in today’s era may not face the pendrive problem, or they may face it like us; in either case this blog is for them, to remind how Version Control transformed development from a chaotic relay race to a symphony where every note is preserved, every musician can be heard, and you can always replay the part that worked.</p>
]]></content:encoded></item><item><title><![CDATA[Git Basics through a Practical Model]]></title><description><![CDATA[I learned why git exists the hard way.
I was working on a semester project based on a Python stack. My teammates handled dataset processing and model training, while I worked on the Streamlit UI. Our workflow was on our local machines, the backend te...]]></description><link>https://blog.sukanta.dev/git-basics</link><guid isPermaLink="true">https://blog.sukanta.dev/git-basics</guid><category><![CDATA[vcs]]></category><category><![CDATA[Git]]></category><category><![CDATA[Devops]]></category><category><![CDATA[GitHub]]></category><dc:creator><![CDATA[Sukanta Bala]]></dc:creator><pubDate>Fri, 16 Jan 2026 20:24:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768594367441/dc575e28-ec41-4515-92e6-10b34d4212d6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I learned why git exists the hard way.</p>
<p>I was working on a semester project based on a Python stack. My teammates handled dataset processing and model training, while I worked on the Streamlit UI. Our workflow was on our local machines, the backend team would send me the updated file, and I would build the UI to use it. We worked in it for a week then submitted to our mentor for review.</p>
<p>Everything went smooth before the mentor review.</p>
<p>We got our project feedback, and I realized that was just version 1.0. Now the project needs new features, bug fixes, and potential refactoring.</p>
<p>And my backend storage looked like this:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768593206793/3e56d3c4-cbd8-4f0c-832a-ae44971c9c4e.png" alt class="image--center mx-auto" /></p>
<p>Get the problem here? The names were ambiguous, files were duplicated, and no one knew which version was actually “correct.” Every change meant another folder, more guessing, and more risk.</p>
<p>So I thought how can we keep track of these files, at a single place, maybe I can use GitHub!</p>
<p>I created a repository, uploaded the files, and thought I was done. When something changed, I planned to upload the modified files again, have a nice day. After some while, a teammate summed it up perfectly:</p>
<p>“bruh just use Google Drive then”. I got humbled and curious. I was just thinking of using GitHub like Google Drive. Then what makes them different? It’s Git.</p>
<h2 id="heading-what-is-git">What is Git?</h2>
<p>Git is like a supervisor, looking over your work and taking pictures of changes you made on it, so you can keep track of it, in an organized and efficient way. Formally, Git is a Version Control System (VCS) which helps managing our projects in a versioned manner.</p>
<p>Attention to my phrase “taking pictures” here, that’s what differentiates Git from other VCSs. Git tracks the changes of every file in the directory by taking snapshots of it.</p>
<p>Also, everything git does is totally local by default. Services like GitHub, GitLab, BitBucket etc is just git being run on a server remotely. You can create your own git server by hosting it on any VPS (Virtual Private Server).</p>
<h2 id="heading-why-git-exists">Why Git exists?</h2>
<p>thought of articulating some points efficiently, but I already shared my lore, and ChatGPT shared some great points:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768495629325/a6fa98ea-f383-49eb-b67e-856ff0e4745a.png" alt /></p>
<h2 id="heading-core-concepts">Core Concepts</h2>
<ul>
<li><p><strong>Repository</strong>: A repository is the working directory you want Git to track, along with the .git folder, which is a database tracking the changes and metadata about the directory. So Repository: Working Directory + .git</p>
</li>
<li><p><strong>Commit</strong>: You created a file, made some changes in an existing file, and want to finalize those changes to the next version of the project. That’s when you perform Commit, to finalize, locally.</p>
</li>
<li><p><strong>Branch</strong>: Branch is what enabled me and my teammate working on our respective parts and features at the same time, and merge them to the main ones after it got finished.</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768593148868/d23861e3-a1c8-4450-acc2-3745716837b4.png" alt class="image--center mx-auto" /></p>
</li>
<li><p><strong>HEAD</strong>: HEAD is a reference to the latest commit in your working directory in the current branch.</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768593223909/6a7c7374-e788-4d8d-a6f4-d6a636814d19.png" alt class="image--center mx-auto" /></p>
</li>
</ul>
<p><strong>Staging Area</strong>: The staging area is a checkpoint between your working directory and the repository. It contains only the specific changes you’ve deliberately selected to be included in the next commit.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768593247172/8489086e-4739-488b-82a0-e26521ad936f.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-essential-commands-to-get-started">Essential Commands to get started</h2>
<ul>
<li><p><strong>Birth of a Project</strong> (<code>git init</code>): Initializes git for the working directory where the command is executed. This command makes a .git directory, initializes the directory metadata and a database. This should be the first command to start using git for your project.</p>
</li>
<li><p><strong>Selective Addition</strong> (<code>git add</code>): Adds the content of added or modified files into the staging area a.k.a. the index. This is the first step towards deciding which makes it to the commit history.</p>
<pre><code class="lang-bash">  git add &lt;file_path&gt;
  git add .            <span class="hljs-comment"># to add all untracked files in the staging area</span>
</code></pre>
</li>
<li><p><strong>Making History Permanent</strong> (<code>git commit</code>): After the desired changes are made in the working directory, this command adds a new commit containing the current contents of the index (staging area) and the given log message describing the changes.</p>
<pre><code class="lang-bash">  git commit -m <span class="hljs-string">"commit message"</span>
  git commit -am <span class="hljs-string">"commit message"</span>    <span class="hljs-comment"># add modified files into the staging area and commit</span>
</code></pre>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768590036353/da9d4ab9-3b27-499f-ba99-589ad3499a5e.png" alt /></p>
</li>
<li><p><strong>Awareness</strong> <strong>before action</strong> (<code>git status</code>): This command shows the files which have been added/deleted or modified since the latest commit. It shows the path of the tracked files (exists in the staging area), and files that have been untracked as well</p>
</li>
<li><p><strong>Seeing the Past</strong> (<code>git log</code>): Logs the commit history in the current branch, along with commit hash, author, date and time, message.</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768590098941/160756c8-78dc-4cd7-878b-adbb35537924.png" alt /></p>
</li>
<li><p><strong>Parallel Timelines</strong> (<code>git branch</code>): A branch in Git is a lightweight pointer to a specific version of your project that lets you work on changes in isolation without affecting the main codebase.</p>
<p>  In my earlier project setup, creating a new feature meant creating a new folder. With Git, I can create a branch instead.</p>
<p>  Instead of this mess</p>
<pre><code class="lang-bash">  backend/
  backend_25jun/
  backend_final/
  backend_final_fixed/
</code></pre>
<p>  I can do better:</p>
</li>
<li><pre><code class="lang-bash">      git branch feat/report
      git switch feat/report
</code></pre>
<p>  Now this is sane and safe, does not tamper the main branch which is currently functional</p>
</li>
<li><p><strong>Understanding Change</strong> (<code>git diff</code>): Before Git, you found differences by opening two folders and eyeballing files. That doesn’t scale, and it misses subtle bugs.</p>
<p>  <code>git diff</code> shows exact line-by-line difference between the working directory and the staging area or the staging area and the last commit.</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768590484680/c0aec064-22b1-4ff5-996c-e15860e0ac18.png" alt /></p>
<p>  It helps finding accidental edits, un-removed debug messages.</p>
</li>
</ul>
<p><code>git status</code> tells something has changed, <code>git diff</code> shows what changed across commits.</p>
<ul>
<li><p><strong>Undoing Mistakes</strong>:</p>
<ul>
<li><p><code>git reset</code>: git reset moves the current branch pointer backward to an earlier commit. It is like “pretend this commit never happened”.</p>
<p>  Git reset only makes sense if the damage is only local. <code>git reset</code> after pushing it remotely is as useful as starting singing after farting in public. The damage is already done.</p>
</li>
<li><p><code>git revert</code>: Reverting is undoing without hiding or rewriting the history. git revert adds a new commit, which undoes the changes made in the last commit and performs it as a new commit.</p>
<p>  revert is the safest option after the changes have been pushed remotely.</p>
</li>
</ul>
</li>
<li><p><strong>Rewriting History, Responsibly</strong> (<code>git rebase</code>): If you are going to stick in this game for long, you are definitely going to make some bunch of small, trivial commits which was necessary for the project, but looks messy while auditing or tracking history.</p>
<p>  git rebase just solves that problem by addressing those commits and organizes them into fewer ones, without changing the actual files in the working directory.</p>
<p>  Another use-case of git rebase is integrating and reorganizing commit history from another branch.</p>
</li>
<li><p><strong>Leaving the Machine</strong> (<code>git push</code>): To collaborate and easy access of your repository, it is convenient to serve your project remotely. <code>git push</code> sends your commits to a remote repository so others can access them.</p>
<p>  Now you get the idea of Git and GitHub.</p>
</li>
</ul>
<h2 id="heading-summary">Summary</h2>
<p>Another point I want to add is: Git is a free and open-source tool created by Linus Torvalds for managing Linux, now it is being managed by the community, for the community. And GitHub is another proprietary piece of Git hosting server with an UI, by Microsoft (what a time to live). Git is a Version Control System, GitHub is a hosting platform.</p>
<p>These commands discussed are enough to get started controlling your project using Git. To learn in-depth, it is always recommended to read the official docs, it IS the gold-standard.</p>
<p>Software development is subjective, it is in it’s nature things will break, and eventually will get fixed. Git gives you the power to attempt your crazy ideas without breaking something which was working few minutes ago.</p>
]]></content:encoded></item></channel></rss>