<?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[Shubham Blog]]></title><description><![CDATA[Shubham Blog]]></description><link>https://blog.shubhampatel.com</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 20:55:57 GMT</lastBuildDate><atom:link href="https://blog.shubhampatel.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[TCP vs UDP: When to Use What, and How TCP Relates to HTTP]]></title><description><![CDATA[1. What are TCP and UDP? (High level)
Think of TCP and UDP as ways to send data from one computer to another.

TCP (Transmission Control Protocol)  Careful, reliable, and ordered.

UDP (User Datagram Protocol)  Fast, lightweight, and “best effort”.

...]]></description><link>https://blog.shubhampatel.com/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</link><guid isPermaLink="true">https://blog.shubhampatel.com/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Shubham Patel]]></dc:creator><pubDate>Wed, 28 Jan 2026 18:01:13 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-1-what-are-tcp-and-udp-high-level">1. What are TCP and UDP? (High level)</h2>
<p>Think of TCP and UDP as <strong>ways to send data from one computer to another</strong>.</p>
<ul>
<li><p><strong>TCP (Transmission Control Protocol)</strong><br />  Careful, reliable, and ordered.</p>
</li>
<li><p><strong>UDP (User Datagram Protocol)</strong><br />  Fast, lightweight, and “best effort”.</p>
</li>
</ul>
<p>They both sit at the <strong>transport layer</strong> and decide <em>how</em> data moves — not <em>what</em> the data means.</p>
<h2 id="heading-2-key-differences-between-tcp-and-udp">2. Key Differences Between TCP and UDP</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Feature</td><td>TCP</td><td>UDP</td></tr>
</thead>
<tbody>
<tr>
<td>Connection</td><td>Yes (connection-oriented)</td><td>No (connectionless)</td></tr>
<tr>
<td>Reliability</td><td>Guaranteed delivery</td><td>No guarantee</td></tr>
<tr>
<td>Order</td><td>Data arrives in order</td><td>Order not guaranteed</td></tr>
<tr>
<td>Speed</td><td>Slower</td><td>Faster</td></tr>
<tr>
<td>Error handling</td><td>Built-in</td><td>Minimal</td></tr>
<tr>
<td>Overhead</td><td>Higher</td><td>Very low</td></tr>
</tbody>
</table>
</div><p><strong>Simple idea:</strong><br />TCP = <em>safe but slower</em><br />UDP = <em>fast but risky</em></p>
<h2 id="heading-3-when-to-use-tcp">3. When to Use TCP</h2>
<p>Use TCP when <strong>data accuracy matters more than speed</strong>.</p>
<p>Examples:</p>
<ul>
<li><p>Web pages</p>
</li>
<li><p>Login systems</p>
</li>
<li><p>Payments</p>
</li>
<li><p>File downloads</p>
</li>
<li><p>Emails</p>
</li>
</ul>
<p>If even <strong>one missing byte</strong> can break things — TCP is the right choice.</p>
<h2 id="heading-4-when-to-use-udp">4. When to Use UDP</h2>
<p>Use UDP when <strong>speed matters more than perfection</strong>.</p>
<p>Examples:</p>
<ul>
<li><p>Live video/audio</p>
</li>
<li><p>Online gaming</p>
</li>
<li><p>Video calls</p>
</li>
<li><p>DNS lookups</p>
</li>
<li><p>Live streaming</p>
</li>
</ul>
<p>Here, losing a packet is better than waiting for it.</p>
<h2 id="heading-5-real-world-analogy">5. Real-World Analogy</h2>
<ul>
<li><p><strong>TCP</strong> → Courier service<br />  Delivers every package, in order, with confirmation.</p>
</li>
<li><p><strong>UDP</strong> → Live announcement<br />  If you miss a word, the speaker doesn’t repeat it.</p>
</li>
</ul>
<p><strong>TCP vs UDP Communication Flow</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769621556710/a6163c44-ad66-4c1a-877c-bbf2d3cde2d6.png" alt /></p>
<h2 id="heading-6-what-is-http">6. What is HTTP?</h2>
<p><strong>HTTP (HyperText Transfer Protocol)</strong> is <strong>not</strong> about sending data —<br />it’s about <strong>defining how browsers and servers talk</strong>.</p>
<p>HTTP answers questions like:</p>
<ul>
<li><p>What is a request?</p>
</li>
<li><p>What is a response?</p>
</li>
<li><p>What does GET or POST mean?</p>
</li>
<li><p>How headers and status codes work</p>
</li>
</ul>
<p>HTTP lives at the <strong>application layer</strong>.</p>
<h2 id="heading-7-relationship-between-tcp-and-http">7. Relationship Between TCP and HTTP</h2>
<p>HTTP <strong>does not replace TCP</strong>.</p>
<p>Instead:</p>
<blockquote>
<p><strong>HTTP runs on top of TCP</strong></p>
</blockquote>
<p>Flow looks like this:</p>
<ol>
<li><p>TCP establishes a reliable connection</p>
</li>
<li><p>HTTP sends requests over that connection</p>
</li>
<li><p>Server responds using HTTP</p>
</li>
<li><p>TCP ensures data arrives correctly</p>
</li>
</ol>
<p><strong>HTTP Request Flow Over TCP Connection</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769622873219/26902854-586c-410d-adc2-723755548ccc.png" alt /></p>
<h2 id="heading-8-common-beginner-confusion">8. Common Beginner Confusion</h2>
<h3 id="heading-is-http-the-same-as-tcp">“Is HTTP the same as TCP?”</h3>
<p>No.</p>
<ul>
<li><p><strong>TCP</strong> → <em>How data is delivered</em></p>
</li>
<li><p><strong>HTTP</strong> → <em>What the data means</em></p>
</li>
</ul>
<p>They solve <strong>different problems</strong>.</p>
<h2 id="heading-9-layering-simplified">9. Layering (Simplified)</h2>
<pre><code class="lang-plaintext">Application Layer → HTTP
Transport Layer   → TCP / UDP
Internet Layer    → IP
</code></pre>
<p><strong>Simplified TCP/IP Layer Mapping</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769623203920/71b56c5a-955c-44d2-84bb-38baa38e85f8.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-10-real-world-usage-mapping">10. Real-World Usage Mapping</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Use Case</strong></td><td><strong>Protocol</strong></td></tr>
</thead>
<tbody>
<tr>
<td>Website loading</td><td>TCP + HTTP</td></tr>
<tr>
<td>Video call</td><td>UDP</td></tr>
<tr>
<td>Online game</td><td>UDP</td></tr>
<tr>
<td>File download</td><td>TCP</td></tr>
<tr>
<td>API request</td><td>TCP + HTTP</td></tr>
</tbody>
</table>
</div>]]></content:encoded></item><item><title><![CDATA[Understanding Network Devices]]></title><description><![CDATA[Before APIs, servers, and cloud deployments — data has to travel through physical network devices.
Let’s understand the core ones, simply.
How the Internet Reaches Your Home or Office
At a very high level, the internet doesn’t magically appear in you...]]></description><link>https://blog.shubhampatel.com/understanding-network-devices</link><guid isPermaLink="true">https://blog.shubhampatel.com/understanding-network-devices</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Shubham Patel]]></dc:creator><pubDate>Tue, 27 Jan 2026 18:52:30 GMT</pubDate><content:encoded><![CDATA[<p>Before APIs, servers, and cloud deployments — <strong>data has to travel through physical network devices</strong>.</p>
<p>Let’s understand the core ones, simply.</p>
<h2 id="heading-how-the-internet-reaches-your-home-or-office">How the Internet Reaches Your Home or Office</h2>
<p>At a very high level, the internet doesn’t magically appear in your laptop.<br />It <strong>travels through cables, devices, and rules</strong>.</p>
<p><strong>Basic flow:</strong></p>
<pre><code class="lang-plaintext">Internet → Modem → Router → Switch → Your Devices
</code></pre>
<h2 id="heading-1-what-is-a-modem">1. What is a Modem?</h2>
<p>A <strong>modem connects your local network to the internet</strong>.</p>
<ul>
<li><p>Internet signals coming from your ISP are <strong>not in a format your devices understand</strong></p>
</li>
<li><p>The modem <strong>converts</strong> those signals into usable digital data</p>
</li>
<li><p>Without a modem, you simply cannot access the internet</p>
</li>
</ul>
<p><strong>Analogy:</strong><br /><em>Translator between your ISP and your home</em></p>
<p><strong>Diagram: Internet → Modem → Router → Devices</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769538954658/b0f1f06e-5534-4d53-ad78-9843b107d7e9.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-2-what-is-a-router">2. What is a Router?</h2>
<p>A <strong>router decides where data should go</strong>.</p>
<ul>
<li><p>It receives data from the modem</p>
</li>
<li><p>Sends it to the correct device (laptop, phone, server)</p>
</li>
<li><p>Uses IP addresses to make routing decisions</p>
</li>
<li><p>Creates a <strong>local network (LAN)</strong></p>
</li>
</ul>
<p><strong>Important:</strong></p>
<ul>
<li><p>Modem = internet connection</p>
</li>
<li><p>Router = traffic direction</p>
</li>
</ul>
<p><strong>Analogy:</strong><br /><em>Traffic police at a junction</em></p>
<p><strong>Router directing traffic to multiple devices</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769539301265/78d08b9b-3eb4-472c-b61e-36430304a4f6.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-3-hub-vs-switch-local-network-devices">3. Hub vs Switch (Local Network Devices)</h2>
<h3 id="heading-hub-old-amp-dumb">Hub (Old &amp; Dumb)</h3>
<ul>
<li><p>Sends data to <strong>all devices</strong></p>
</li>
<li><p>No idea who actually needs it</p>
</li>
<li><p>Causes collisions and slow networks</p>
</li>
</ul>
<h3 id="heading-switch-smart-amp-modern">Switch (Smart &amp; Modern)</h3>
<ul>
<li><p>Sends data <strong>only to the intended device</strong></p>
</li>
<li><p>Learns MAC addresses</p>
</li>
<li><p>Faster and more secure</p>
</li>
</ul>
<p><strong>Key difference:</strong></p>
<blockquote>
<p>Hub broadcasts, Switch delivers.</p>
</blockquote>
<p><strong>Analogy:</strong></p>
<ul>
<li><p>Hub → shouting in a room</p>
</li>
<li><p>Switch → delivering to the correct mailbox</p>
</li>
</ul>
<p><strong>Hub vs Switch packet broadcast comparison</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769539437118/176dde46-f25f-4efc-ab1a-bafea504592b.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-4-what-is-a-firewall">4. What is a Firewall?</h2>
<p>A <strong>firewall controls what is allowed in and out</strong> of a network.</p>
<ul>
<li><p>Blocks malicious traffic</p>
</li>
<li><p>Allows trusted requests</p>
</li>
<li><p>Can be hardware or software</p>
</li>
<li><p>Rules are based on IP, port, protocol</p>
</li>
</ul>
<p><strong>Security lives here.</strong></p>
<p><strong>Analogy:</strong><br /><em>Security gate checking ID</em></p>
<p><strong>Firewall placement between internet and internal network</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769539543130/a83ca1ff-a354-44b1-933f-4ac2116c6e33.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-5-what-is-a-load-balancer">5. What is a Load Balancer?</h2>
<p>A <strong>load balancer distributes traffic across multiple servers</strong>.</p>
<ul>
<li><p>Prevents one server from getting overloaded</p>
</li>
<li><p>Improves availability and performance</p>
</li>
<li><p>Essential for scalable systems</p>
</li>
</ul>
<p>Used heavily in:</p>
<ul>
<li><p>Production web apps</p>
</li>
<li><p>Microservices</p>
</li>
<li><p>Cloud infrastructure</p>
</li>
</ul>
<p><strong>Analogy:</strong><br /><em>Toll booth directing cars to multiple lanes</em></p>
<p><strong>Load balancer distributing traffic to servers</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769539686700/fd097d3b-c8aa-4460-8137-23ca978041a5.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-6-how-all-these-devices-work-together-real-world">6. How All These Devices Work Together (Real World)</h2>
<p>For a typical web application:</p>
<pre><code class="lang-plaintext">User
 ↓
Internet
 ↓
Firewall
 ↓
Load Balancer
 ↓
Web Servers
 ↓
Database
</code></pre>
<p>At home or office:</p>
<pre><code class="lang-plaintext">Internet → Modem → Router → Switch → Devices
</code></pre>
<p>Each device <strong>does one job well</strong> — and together, they make the network reliable.</p>
<p><strong>End-to-end network architecture for a web application</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769539922322/1f18532e-bcb4-40d2-8ad1-d893b758ef8c.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-why-software-engineers-should-care">Why Software Engineers Should Care</h2>
<p>Even if you write only code:</p>
<ul>
<li><p>APIs fail because of firewalls</p>
</li>
<li><p>Servers crash without load balancing</p>
</li>
<li><p>Latency issues often come from routing</p>
</li>
<li><p>Production bugs are sometimes <strong>network bugs</strong></p>
</li>
</ul>
<p>Understanding hardware makes you a <strong>better backend and system engineer</strong>.</p>
]]></content:encoded></item><item><title><![CDATA[How DNS Resolution Works]]></title><description><![CDATA[When you type google.com in a browser, a lot happens behind the scenes before the page loads.That entire process is called DNS resolution.
Let’s break it down step by step using the dig command.
1. What is DNS and why name resolution exists
Computers...]]></description><link>https://blog.shubhampatel.com/how-dns-resolution-works</link><guid isPermaLink="true">https://blog.shubhampatel.com/how-dns-resolution-works</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Shubham Patel]]></dc:creator><pubDate>Tue, 27 Jan 2026 18:24:42 GMT</pubDate><content:encoded><![CDATA[<p>When you type <a target="_blank" href="http://google.com"><code>google.com</code></a> in a browser, a lot happens behind the scenes before the page loads.<br />That entire process is called <strong>DNS resolution</strong>.</p>
<p>Let’s break it down step by step using the <code>dig</code> command.</p>
<h2 id="heading-1-what-is-dns-and-why-name-resolution-exists">1. What is DNS and why name resolution exists</h2>
<p>Computers don’t understand domain names.<br />They only understand <strong>IP addresses</strong> like <code>142.250.190.14</code>.</p>
<p>DNS (Domain Name System) exists to <strong>translate human-friendly names into machine-friendly IPs</strong>.</p>
<p>Think of DNS as the <strong>internet’s phonebook</strong>:</p>
<ul>
<li><p>Name → Phone number</p>
</li>
<li><p>Domain → IP address</p>
</li>
</ul>
<p>Without DNS, we’d have to remember IPs for every website.</p>
<h2 id="heading-2-what-is-the-dig-command-and-when-it-is-used">2. What is the <code>dig</code> command and when it is used</h2>
<p><code>dig</code> stands for <strong>Domain Information Groper</strong>.</p>
<p>It is a command-line tool used to:</p>
<ul>
<li><p>Inspect DNS records</p>
</li>
<li><p>Debug DNS issues</p>
</li>
<li><p>Understand how name resolution works internally</p>
</li>
</ul>
<p>Unlike browsers, <code>dig</code> shows <strong>raw DNS responses</strong>.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">dig google.com
</code></pre>
<h2 id="heading-3-understanding-dig-ns-root-name-servers">3. Understanding <code>dig . NS</code> (Root Name Servers)</h2>
<p>Let’s start from the top of the DNS hierarchy.</p>
<pre><code class="lang-plaintext">dig . NS
</code></pre>
<p>This asks:</p>
<blockquote>
<p>“Who controls the root of DNS?”</p>
</blockquote>
<p>The response lists <strong>root name servers</strong> like:</p>
<pre><code class="lang-plaintext">a.root-servers.net
b.root-servers.net
...
</code></pre>
<p>These servers <strong>don’t know IPs of websites</strong>.<br />They only know <strong>where to find TLD servers</strong>.</p>
<p>Root servers are the <strong>starting point</strong> of every DNS lookup.</p>
<p><strong>DNS hierarchy – Root level</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769537370787/1ea908d1-a743-4026-94bf-5f490d7e3b5e.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-4-understanding-dig-com-ns-tld-name-servers">4. Understanding <code>dig com NS</code> (TLD Name Servers)</h2>
<p>Next layer: <strong>Top-Level Domain (TLD)</strong>.</p>
<pre><code class="lang-plaintext">dig com NS
</code></pre>
<p>This asks:</p>
<blockquote>
<p>“Who manages <code>.com</code> domains?”</p>
</blockquote>
<p>The answer returns <code>.com</code> name servers (run by Verisign).</p>
<p>TLD servers:</p>
<ul>
<li><p>Don’t know IP addresses</p>
</li>
<li><p>Know <strong>which authoritative servers manage a domain</strong></p>
</li>
</ul>
<p><strong>Root → TLD (.com)</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769537585283/7cf50080-4eb7-482f-adfc-e49282ae5300.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-5-understanding-dig-googlecomhttpgooglecom-ns-authoritative-servers">5. Understanding <code>dig</code> <a target="_blank" href="http://google.com"><code>google.com</code></a> <code>NS</code> (Authoritative Servers)</h2>
<p>Now let’s ask about a specific domain.</p>
<pre><code class="lang-plaintext">dig google.com NS
</code></pre>
<p>This returns Google’s <strong>authoritative name servers</strong> like:</p>
<pre><code class="lang-plaintext">ns1.google.com
ns2.google.com
</code></pre>
<p>Authoritative servers:</p>
<ul>
<li><p>Hold the <strong>actual DNS records</strong></p>
</li>
<li><p>Are the final source of truth</p>
</li>
</ul>
<p>This is where real answers live.</p>
<p><strong>TLD → Authoritative servers</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769537825548/7042e825-d434-4938-b3b1-edda22f3ac19.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-6-understanding-dig-googlecomhttpgooglecom-full-resolution-flow">6. Understanding <code>dig</code> <a target="_blank" href="http://google.com"><code>google.com</code></a> (Full Resolution Flow)</h2>
<p>Now the real question:</p>
<pre><code class="lang-plaintext">dig google.com
</code></pre>
<p>This returns:</p>
<ul>
<li><p>A record (IPv4 address)</p>
</li>
<li><p>Sometimes AAAA (IPv6)</p>
</li>
<li><p>TTL values</p>
</li>
</ul>
<p>Behind the scenes, the resolver does this:</p>
<ol>
<li><p>Ask root servers → where is <code>.com</code>?</p>
</li>
<li><p>Ask <code>.com</code> servers → where is <a target="_blank" href="http://google.com"><code>google.com</code></a>?</p>
</li>
<li><p>Ask Google’s authoritative servers → what is the IP?</p>
</li>
</ol>
<p>Your browser <strong>never talks directly</strong> to root or TLD servers.<br />A <strong>recursive resolver</strong> (ISP / Google DNS / Cloudflare) does this for you.</p>
<p><strong>Full DNS resolution flow for</strong> <a target="_blank" href="http://google.com"><strong>google.com</strong></a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769538169490/627cdc07-4ceb-4a31-a2f2-6186eed684ad.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-how-recursive-resolvers-fit-in">How recursive resolvers fit in</h2>
<p>Recursive resolvers:</p>
<ul>
<li><p>Cache DNS results</p>
</li>
<li><p>Reduce latency</p>
</li>
<li><p>Protect root/TLD servers from overload</p>
</li>
</ul>
<p>Popular resolvers:</p>
<ul>
<li><p><code>8.8.8.8</code> (Google)</p>
</li>
<li><p><code>1.1.1.1</code> (Cloudflare)</p>
</li>
</ul>
<p>They repeat the root → TLD → authoritative process <strong>only when needed</strong>.</p>
<p><strong>Recursive resolver interaction</strong></p>
<p><img src="https://www.researchgate.net/profile/Zhou-Li-19/publication/330006223/figure/fig1/AS:709642057445377@1546203259697/Domain-resolution-process-with-a-recursive-resolver.ppm" alt /></p>
<h2 id="heading-connecting-dns-to-real-browser-requests">Connecting DNS to real browser requests</h2>
<p>When DNS resolution finishes:</p>
<ul>
<li><p>Browser gets IP address</p>
</li>
<li><p>TCP connection starts</p>
</li>
<li><p>HTTPS handshake happens</p>
</li>
<li><p>HTTP request is sent</p>
</li>
</ul>
<p>DNS is <strong>step zero</strong> of every web request.</p>
<p>If DNS fails, <strong>nothing loads</strong>.</p>
]]></content:encoded></item><item><title><![CDATA[Getting Started with cURL]]></title><description><![CDATA[When you build software, you constantly need to talk to servers.cURL is one of the simplest ways to do that—directly from your terminal.
What is a Server?
A server is just another computer on the internet that:

Receives requests

Processes them

Sen...]]></description><link>https://blog.shubhampatel.com/getting-started-with-curl</link><guid isPermaLink="true">https://blog.shubhampatel.com/getting-started-with-curl</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Shubham Patel]]></dc:creator><pubDate>Tue, 27 Jan 2026 18:01:15 GMT</pubDate><content:encoded><![CDATA[<p>When you build software, you constantly need to <strong>talk to servers</strong>.<br />cURL is one of the simplest ways to do that—directly from your terminal.</p>
<h2 id="heading-what-is-a-server">What is a Server?</h2>
<p>A server is just another computer on the internet that:</p>
<ul>
<li><p>Receives requests</p>
</li>
<li><p>Processes them</p>
</li>
<li><p>Sends back a response</p>
</li>
</ul>
<p>Your browser talks to servers all the time. cURL lets you talk to servers manually.</p>
<h2 id="heading-what-is-curl">What is cURL?</h2>
<p><strong>cURL</strong> is a command-line tool used to send requests to a server and see the response.</p>
<p>Think of it as:</p>
<blockquote>
<p>A browser, but without buttons—only commands.</p>
</blockquote>
<p>You type a command → server responds → you see the result in the terminal.</p>
<h2 id="heading-why-programmers-need-curl">Why Programmers Need cURL</h2>
<p>Programmers use cURL to:</p>
<ul>
<li><p>Test APIs quickly</p>
</li>
<li><p>Check server responses</p>
</li>
<li><p>Debug backend issues</p>
</li>
<li><p>Work without a browser or UI</p>
</li>
<li><p>Automate requests</p>
</li>
</ul>
<p>If you work with backend, APIs, or DevOps—cURL becomes a daily tool.</p>
<h2 id="heading-your-first-curl-request">Your First cURL Request</h2>
<p>The simplest possible command:</p>
<pre><code class="lang-plaintext">curl https://example.com
</code></pre>
<p>This command:</p>
<ul>
<li><p>Sends a request to the server</p>
</li>
<li><p>Fetches the webpage</p>
</li>
<li><p>Prints the response in your terminal</p>
</li>
</ul>
<h2 id="heading-what-just-happened-request-amp-response">What Just Happened? (Request &amp; Response)</h2>
<p>When you ran the command:</p>
<ol>
<li><p>cURL sent a <strong>request</strong></p>
</li>
<li><p>The server processed it</p>
</li>
<li><p>The server sent back a <strong>response</strong></p>
</li>
</ol>
<p>The response usually contains:</p>
<ul>
<li><p><strong>Status</strong> (was it successful or not?)</p>
</li>
<li><p><strong>Data</strong> (HTML, JSON, text, etc.)</p>
</li>
</ul>
<p><img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm4061u6jlu03xspsnnmh.png" alt="cURL: A beginner's guide - DEV Community" /></p>
<h2 id="heading-browser-request-vs-curl-request">Browser Request vs cURL Request</h2>
<p>A browser:</p>
<ul>
<li><p>Sends requests automatically</p>
</li>
<li><p>Renders HTML visually</p>
</li>
<li><p>Hides technical details</p>
</li>
</ul>
<p>cURL:</p>
<ul>
<li><p>Sends requests manually</p>
</li>
<li><p>Shows raw data</p>
</li>
<li><p>Gives full control</p>
</li>
</ul>
<p>Both talk to the same server - just differently.</p>
<p><strong>Browser request vs cURL request</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769536190125/c4115e6a-2f2b-483c-b572-ced272dc6294.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-talking-to-apis-using-curl">Talking to APIs Using cURL</h2>
<p>APIs are servers that usually return <strong>JSON</strong> instead of HTML.</p>
<p>Eg:</p>
<pre><code class="lang-plaintext">curl https://api.example.com/users
</code></pre>
<p>You’ll see raw data like:</p>
<pre><code class="lang-plaintext">[
  { "id": 1, "name": "John" }
]
</code></pre>
<p>This is how developers test APIs before connecting them to apps.</p>
<h2 id="heading-get-and-post-only-the-basics">GET and POST (Only the Basics)</h2>
<ul>
<li><p><strong>GET</strong> → Fetch data</p>
</li>
<li><p><strong>POST</strong> → Send data</p>
</li>
</ul>
<p>For now, just remember:</p>
<blockquote>
<p>Most simple cURL commands you run are GET requests by default.</p>
</blockquote>
<p>We’ll explore POST later—no rush.</p>
<p><strong>Basic HTTP request &amp; response structure</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769536566655/d10f5432-a6eb-4f62-a522-35b21c38e9fe.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-common-mistakes-beginners-make">Common Mistakes Beginners Make</h2>
<ul>
<li><p>Trying too many flags too early</p>
</li>
<li><p>Copy-pasting complex commands without understanding</p>
</li>
<li><p>Expecting cURL to behave like a browser</p>
</li>
<li><p>Ignoring error messages</p>
</li>
</ul>
<p>Start small. One command at a time.</p>
<h2 id="heading-where-curl-fits-in-backend-development">Where cURL Fits in Backend Development</h2>
<p>cURL is used:</p>
<ul>
<li><p>Before frontend exists</p>
</li>
<li><p>While building APIs</p>
</li>
<li><p>During debugging</p>
</li>
<li><p>In CI/CD scripts</p>
</li>
<li><p>On servers without browsers</p>
</li>
</ul>
<p>If backend is the engine, <strong>cURL is the diagnostic tool</strong>.</p>
<p><strong>Where cURL fits in backend development</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769536848227/c6b58e6f-fa67-4e34-b080-3da8056aa453.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[DNS Records Explained Simply (For Beginners)]]></title><description><![CDATA[How does a browser know where a website lives?
When you type google.com in your browser, your computer doesn’t magically know where it is.It needs an address — just like you need a house address to visit someone.
That’s where DNS comes in.
What is DN...]]></description><link>https://blog.shubhampatel.com/dns-records-explained-simply-for-beginners</link><guid isPermaLink="true">https://blog.shubhampatel.com/dns-records-explained-simply-for-beginners</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Shubham Patel]]></dc:creator><pubDate>Tue, 27 Jan 2026 17:36:25 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-how-does-a-browser-know-where-a-website-lives">How does a browser know where a website lives?</h2>
<p>When you type <a target="_blank" href="http://google.com"><code>google.com</code></a> in your browser, your computer doesn’t magically know where it is.<br />It needs an address — just like you need a house address to visit someone.</p>
<p>That’s where <strong>DNS</strong> comes in.</p>
<h2 id="heading-what-is-dns-very-simple">What is DNS? (Very simple)</h2>
<p><strong>DNS is the phonebook of the internet.</strong></p>
<ul>
<li><p>You remember names like <a target="_blank" href="http://example.com"><code>example.com</code></a></p>
</li>
<li><p>Computers understand numbers like <code>142.250.190.14</code></p>
</li>
</ul>
<p>DNS connects the <strong>name</strong> to the <strong>number</strong>.</p>
<h2 id="heading-what-is-dns-very-simple-1">What is DNS? (Very simple)</h2>
<p><strong>DNS is the phonebook of the internet.</strong></p>
<ul>
<li><p>You remember names like <a target="_blank" href="http://example.com"><code>example.com</code></a></p>
</li>
<li><p>Computers understand numbers like <code>142.250.190.14</code></p>
</li>
</ul>
<p>DNS connects the <strong>name</strong> to the <strong>number</strong>.</p>
<p><img src="https://lh6.googleusercontent.com/9HL6XqrvIqt7YlVfRsCp9dpVfg6sj8aJ-M1FO-nzL0XLkGLpOBbe_orlVbdo9VeGpGFHFMgi_POOGzi83HGl1A1dHkZDfDsaC0XdZ2SzyBJ0bLy84ABckxC74a17mX11RcyyK_3QMIAu5sMl2dqfAUXZ6wmUGtZzEqxKGCnTX-uhEpcOUN8oazTf8Ccm5A" alt="What is DNS - Domain Name System ? - sagarfive" /></p>
<h2 id="heading-why-do-we-need-dns-records">Why do we need DNS records?</h2>
<p>A domain name needs different instructions:</p>
<ul>
<li><p>Where the website is hosted</p>
</li>
<li><p>Who handles email</p>
</li>
<li><p>Which service owns the domain</p>
</li>
<li><p>Extra verification info</p>
</li>
</ul>
<p>Each instruction is stored as a <strong>DNS record</strong>.</p>
<h2 id="heading-ns-record-who-is-responsible-for-this-domain">NS Record – Who is responsible for this domain?</h2>
<p><strong>NS (Name Server) records decide who controls the domain’s DNS.</strong></p>
<p>They answer:</p>
<blockquote>
<p>“Which DNS service should be trusted for this domain?”</p>
</blockquote>
<pre><code class="lang-plaintext">ns1.hostinger.com
ns2.hostinger.com
</code></pre>
<p>If NS records point to Hostinger, Hostinger manages all other records.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769534055588/6c61a6d9-41a8-43c8-83ae-4403f766d412.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-a-record-domain-ipv4-address">A Record Domain - IPv4 address</h2>
<p><strong>A record connects a domain to a server IP (IPv4).</strong></p>
<p>Eg:</p>
<pre><code class="lang-plaintext">example.com → 93.184.216.34
</code></pre>
<p>This is how browsers reach your website server.</p>
<p><img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxlqzaobhutmuxtnc8m09.jpeg" alt="DNS Basics: How Domain Name System Connects Websites - DEV Community" /></p>
<h2 id="heading-aaaa-record-domain-ipv6-address">AAAA Record – Domain → IPv6 address</h2>
<p>Same as an A record, but for <strong>IPv6</strong> (newer IP format).</p>
<p>Eg:</p>
<pre><code class="lang-plaintext">example.com → 2606:2800:220:1:248:1893:25c8:1946
</code></pre>
<p>Not mandatory, but good to have if your server supports IPv6.</p>
<h2 id="heading-cname-record-one-name-pointing-to-another-name">CNAME Record – One name pointing to another name</h2>
<p><strong>CNAME is an alias.</strong></p>
<p>Instead of pointing to an IP, it points to another domain.</p>
<p>Eg:</p>
<pre><code class="lang-plaintext">www.example.com → example.com
</code></pre>
<p>So you don’t manage multiple IPs.</p>
<p><strong>A record → IP address</strong><br /><strong>CNAME → another domain name</strong></p>
<p><img src="https://0xpatrik.com/content/images/2018/06/notation.png" alt /></p>
<h2 id="heading-mx-record-how-emails-find-your-mail-server">MX Record – How emails find your mail server</h2>
<p><strong>MX (Mail Exchange) records tell emails where to go.</strong></p>
<p>When someone emails <a target="_blank" href="mailto:you@example.com"><code>you@example.com</code></a>, MX records guide the email to the correct mail server.</p>
<p>Eg:</p>
<pre><code class="lang-plaintext">example.com → mail.google.com
</code></pre>
<p><strong>NS = who controls DNS<br />MX = who receives email</strong></p>
<p><img src="https://cdn.prod.website-files.com/644fc991ce69ff211edbeb95/6784e2f1ada454ed0dee61b5_6784df6df41a3ae516b22e52_image3.png" alt="Configure MX Records for Google Workspace Email Setup" /></p>
<h2 id="heading-txt-record-extra-information-amp-verification">TXT Record - Extra information &amp; verification</h2>
<p><strong>TXT records store plain text instructions.</strong></p>
<p>Used for:</p>
<ul>
<li><p>Domain verification</p>
</li>
<li><p>Email security (SPF, DKIM)</p>
</li>
<li><p>Ownership proof</p>
</li>
</ul>
<p>Example:</p>
<pre><code class="lang-plaintext">"v=spf1 include:_spf.google.com ~all"
</code></pre>
<p>You usually don’t “use” TXT records directly — services ask you to add them.</p>
<h2 id="heading-how-all-dns-records-work-together-one-website-example">How all DNS records work together (one website example)</h2>
<p>For a simple website:</p>
<ul>
<li><p><strong>NS</strong> → DNS provider</p>
</li>
<li><p><strong>A / AAAA</strong> → Website server</p>
</li>
<li><p><strong>CNAME</strong> → <code>www</code> handling</p>
</li>
<li><p><strong>MX</strong> → Email service</p>
</li>
<li><p><strong>TXT</strong> → Verification &amp; security</p>
</li>
</ul>
<p>All records work silently in the background — fast and invisible.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769535359777/bcd10613-b054-44d9-952d-c711517cac6c.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[Why Version Control Exists: The Pendrive Problem]]></title><description><![CDATA[Before Git, GitHub, and cloud repositories became part of every developer’s daily life, software development looked very different. It was messier, riskier, and often frustrating. If you’ve been around long enough—or talked to senior developers—you’v...]]></description><link>https://blog.shubhampatel.com/why-version-control-exists-the-pendrive-problem</link><guid isPermaLink="true">https://blog.shubhampatel.com/why-version-control-exists-the-pendrive-problem</guid><category><![CDATA[Git]]></category><category><![CDATA[Chaiaurcode]]></category><dc:creator><![CDATA[Shubham Patel]]></dc:creator><pubDate>Sat, 17 Jan 2026 10:20:30 GMT</pubDate><content:encoded><![CDATA[<p>Before Git, GitHub, and cloud repositories became part of every developer’s daily life, software development looked very different. It was messier, riskier, and often frustrating. If you’ve been around long enough—or talked to senior developers—you’ve probably heard stories about <em>pendrives</em>, <em>email attachments</em>, and folders named <strong>final</strong>, <strong>final_v2</strong>, or <strong>latest_final_really_this_one</strong>.</p>
<p>This article explores <strong>why version control exists</strong>, using the <strong>pendrive analogy</strong> to explain the real problems developers faced before modern version control systems became mandatory.</p>
<h2 id="heading-life-before-version-control">Life Before Version Control</h2>
<p>Imagine a small development team working on the same project.</p>
<p>There is no Git. No GitHub. No GitLab.</p>
<p>Instead, there is:</p>
<ul>
<li><p>A single pendrive</p>
</li>
<li><p>Email attachments</p>
</li>
<li><p>Shared folders on someone’s computer</p>
</li>
</ul>
<p>The workflow usually looked like this:</p>
<ol>
<li><p>Developer A writes code and saves it to a pendrive.</p>
</li>
<li><p>Developer A hands the pendrive to Developer B.</p>
</li>
<li><p>Developer B copies the files, makes changes, and saves them back.</p>
</li>
<li><p>Someone forgets to copy the <em>latest</em> version.</p>
</li>
<li><p>Chaos begins.</p>
</li>
</ol>
<p>This approach worked <em>only</em> when projects were tiny and teams were small. As soon as complexity increased, problems became unavoidable.</p>
<h2 id="heading-the-pendrive-analogy-in-software-development">The Pendrive Analogy in Software Development</h2>
<p>Think of a pendrive as the <strong>single source of truth</strong>.</p>
<p>Whoever has the pendrive has the latest version of the code.</p>
<p>Sounds simple, right? But this simplicity hides serious flaws.</p>
<h3 id="heading-example-scenario">Example Scenario</h3>
<ul>
<li><p>You update <code>login.js</code> on the pendrive.</p>
</li>
<li><p>Your teammate updates <code>dashboard.js</code> on their local machine.</p>
</li>
<li><p>Both changes are important.</p>
</li>
<li><p>Only one version fits on the pendrive at a time.</p>
</li>
</ul>
<p>Someone’s work <em>will</em> be lost.</p>
<p>To avoid this, developers started creating copies:</p>
<ul>
<li><p><code>project_final</code></p>
</li>
<li><p><code>project_final_v2</code></p>
</li>
<li><p><code>project_latest</code></p>
</li>
<li><p><code>project_latest_final</code></p>
</li>
</ul>
<p>Instead of solving the problem, this created confusion.</p>
<p>No one knew:</p>
<ul>
<li><p>Which version was correct</p>
</li>
<li><p>Who changed what</p>
</li>
<li><p>When the change was made</p>
</li>
<li><p>Why the change was made</p>
</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/1*IrVmoYv3tvKoyFh2BvNoFg.jpeg" alt="Life Before Version Control: Problems, Pain Points, and Why Version Control  Changed Everything | by Yash Kumar Halder | Jan, 2026 | Medium" /></p>
<h2 id="heading-problems-faced-before-version-control-systems">Problems Faced Before Version Control Systems</h2>
<h3 id="heading-1-overwriting-code">1. Overwriting Code</h3>
<p>Two developers edited the same file. One copied their version last.</p>
<p>The other developer’s work vanished.</p>
<p>No warning. No recovery.</p>
<h3 id="heading-2-losing-changes-forever">2. Losing Changes Forever</h3>
<p>There was no history.</p>
<p>If something broke, you couldn’t:</p>
<ul>
<li><p>Go back to yesterday’s version</p>
</li>
<li><p>Compare changes</p>
</li>
<li><p>Undo a mistake</p>
</li>
</ul>
<p>Once lost, the code was gone.</p>
<h3 id="heading-3-no-collaboration-history">3. No Collaboration History</h3>
<p>Questions like these had no answers:</p>
<ul>
<li><p>Who wrote this code?</p>
</li>
<li><p>Why was this logic added?</p>
</li>
<li><p>When did this bug appear?</p>
</li>
</ul>
<p>Debugging became guesswork instead of investigation.</p>
<h3 id="heading-4-fear-of-making-changes">4. Fear of Making Changes</h3>
<p>Developers were afraid to touch working code.</p>
<p>A simple update could break everything, and there was no safety net.</p>
<p>Innovation slowed down.</p>
<h3 id="heading-5-impossible-team-scaling">5. Impossible Team Scaling</h3>
<p>Pendrive-based workflows collapse as soon as:</p>
<ul>
<li><p>The team grows</p>
</li>
<li><p>Multiple features are developed in parallel</p>
</li>
<li><p>Deadlines become tight</p>
</li>
</ul>
<p>Collaboration simply does not scale.</p>
<h2 id="heading-real-world-team-collaboration-problems">Real-World Team Collaboration Problems</h2>
<p>Now imagine this pendrive workflow in:</p>
<ul>
<li><p>A startup with 10 developers</p>
</li>
<li><p>A company with remote teams</p>
</li>
<li><p>An open-source project</p>
</li>
</ul>
<p>It’s impossible.</p>
<p>Developers need to:</p>
<ul>
<li><p>Work in parallel</p>
</li>
<li><p>Experiment without fear</p>
</li>
<li><p>Track every change</p>
</li>
<li><p>Merge work safely</p>
</li>
</ul>
<p>The pendrive model cannot handle this reality.</p>
<h2 id="heading-why-version-control-became-mandatory">Why Version Control Became Mandatory</h2>
<p>Version control systems were created to solve <strong>exactly these problems</strong>.</p>
<p>They introduced:</p>
<ul>
<li><p>A complete history of changes</p>
</li>
<li><p>Safe collaboration</p>
</li>
<li><p>Conflict detection instead of silent overwrites</p>
</li>
<li><p>The ability to roll back anytime</p>
</li>
</ul>
<p>Instead of passing pendrives, developers now:</p>
<ul>
<li><p>Clone repositories</p>
</li>
<li><p>Create branches</p>
</li>
<li><p>Commit small, meaningful changes</p>
</li>
<li><p>Merge work with confidence</p>
</li>
</ul>
<p>Version control turned software development from a fragile process into a reliable system.</p>
<h2 id="heading-pendrive-workflow-vs-version-control-workflow">Pendrive Workflow vs Version Control Workflow</h2>
<p><strong>Pendrive Workflow:</strong></p>
<ul>
<li><p>One copy at a time</p>
</li>
<li><p>Manual sharing</p>
</li>
<li><p>No history</p>
</li>
<li><p>High risk of data loss</p>
</li>
</ul>
<p><strong>Version Control Workflow:</strong></p>
<ul>
<li><p>Everyone has a full copy</p>
</li>
<li><p>Automatic tracking</p>
</li>
<li><p>Complete history</p>
</li>
<li><p>Designed for collaboration</p>
</li>
</ul>
<p>What once required discipline, memory, and luck is now handled by tools.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/1*1CDBOontNAUG087s4iPZ4Q.png" alt="Why Version Control Exists: The Pendrive Problem | by Rushisalunke | Dec,  2025 | Medium" /></p>
<h2 id="heading-why-this-still-matters-today">Why This Still Matters Today</h2>
<p>If you’ve ever:</p>
<ul>
<li><p>Used Git</p>
</li>
<li><p>Fixed a bug by checking commit history</p>
</li>
<li><p>Reverted a broken deployment</p>
</li>
</ul>
<p>You’ve benefited from lessons learned during the pendrive era.</p>
<p>Version control doesn’t just store code.</p>
<p>It stores <strong>context, history, and collaboration</strong>.</p>
<p>And that’s why version control exists.</p>
]]></content:encoded></item><item><title><![CDATA[Inside Git: How It Works and the Role of the .git Folder]]></title><description><![CDATA[How Git Works Internally
Git works internally by storing project snapshots in a hidden .git folder using simple data chunks called objects.
Core Layers
Your files sit in the working directory, changes go to the staging area (index), and commits save ...]]></description><link>https://blog.shubhampatel.com/inside-git-how-it-works-and-the-role-of-the-git-folder</link><guid isPermaLink="true">https://blog.shubhampatel.com/inside-git-how-it-works-and-the-role-of-the-git-folder</guid><category><![CDATA[Git]]></category><category><![CDATA[ChaiCohort]]></category><dc:creator><![CDATA[Shubham Patel]]></dc:creator><pubDate>Sat, 17 Jan 2026 10:13:40 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-how-git-works-internally">How Git Works Internally</h2>
<p>Git works internally by storing project snapshots in a hidden .git folder using simple data chunks called objects.</p>
<h3 id="heading-core-layers"><strong>Core Layers</strong></h3>
<p>Your files sit in the working directory, changes go to the staging area (index), and commits save full snapshots to the repository. This three-layer setup lets you prepare changes before locking them in. Hashes (SHA-1 codes) name each piece uniquely from its content.</p>
<h3 id="heading-key-objects">Key Objects</h3>
<p>• <strong>Blob:</strong> Raw file data, no path or name.<br />• <strong>Tree:</strong> Maps folders and files to their blobs or sub-trees.<br />• <strong>Commit:</strong> Links a tree snapshot, parents, author, date, and message.</p>
<p><img src="https://git-scm.com/book/en/v2/images/data-model-1.png" alt="Git - Git Objects" /></p>
<p>These form chains; identical content reuses the same hash for efficiency.</p>
<h3 id="heading-git-add-step">git add Step</h3>
<p>Git hashes changed files into blobs and updates the index with paths and hashes. Staging prepares a clean snapshot without altering your work files.</p>
<h3 id="heading-git-commit-step">git commit Step</h3>
<p>From the index, Git builds trees, creates a commit object, and points your branch (via refs/) to its hash. History grows as a chain or branches, all verified by hashes.</p>
<h3 id="heading-simple-model">Simple Model</h3>
<p>Picture a chain of photo albums (commits) where each photo (tree) shows folder layouts of pictures (blobs). Edit a picture? New hash ripples up, creating a fresh album. Branches are just labels sliding along the chain.</p>
<p><img src="https://qph.cf2.quoracdn.net/main-qimg-ef6ba6c5b923f9c3967279f03974f456" alt="How necessary is it to have both add and commit stages in git? - Quora" /></p>
<h2 id="heading-understanding-the-git-folder">Understanding the <code>.git</code> Folder</h2>
<p>The .git folder is Git’s hidden storage for all project history and data. It keeps your work safe without cluttering files.</p>
<h3 id="heading-why-it-exists">Why It Exists</h3>
<p>Git uses .git to track every change, store commits, and manage branches. Delete it, and your project loses all version history.</p>
<h3 id="heading-main-parts-inside">Main Parts Inside</h3>
<p>• <strong>objects/:</strong> Packed files, folders, and commits as hashed data.<br />• <strong>refs/:</strong> Points to branches and tags.<br />• <strong>index:</strong> Staging area for git add.<br />• <strong>HEAD:</strong> Current branch or commit.<br />• <strong>config:</strong> Repo settings.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768644639520/e4368e10-4375-4dfb-9f92-6063728dddb3.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[for Beginners: Basics and Essential Commands]]></title><description><![CDATA[What is Git?
Git serves as a distributed version control system that tracks changes in your code, enabling multiple developers to collaborate efficiently without overwriting each other’s work. Before Git, developers faced issues like manually copying...]]></description><link>https://blog.shubhampatel.com/for-beginners-basics-and-essential-commands</link><guid isPermaLink="true">https://blog.shubhampatel.com/for-beginners-basics-and-essential-commands</guid><category><![CDATA[Git]]></category><category><![CDATA[ChaiCohort]]></category><dc:creator><![CDATA[Shubham Patel]]></dc:creator><pubDate>Sat, 17 Jan 2026 10:06:31 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-what-is-git">What is Git?</h2>
<p>Git serves as a distributed version control system that tracks changes in your code, enabling multiple developers to collaborate efficiently without overwriting each other’s work. Before Git, developers faced issues like manually copying code via pendrives or email, leading to version confusion, lost changes, and merge nightmares when combining files.</p>
<h3 id="heading-why-use-git">Why Use Git</h3>
<p>Git eliminates the chaos of traditional methods by creating snapshots of your project at any point, allowing you to revert changes, experiment safely, and maintain a complete history locally. Its distributed nature means every developer has a full copy of the repository, reducing reliance on central servers and enabling offline work.</p>
<p><img src="https://miro.medium.com/1*diRLm1S5hkVoh5qeArND0Q.png" alt="Git Gud: The Working Tree, Staging Area, and Local Repo | by Lucas Maurer |  Medium" /></p>
<h3 id="heading-core-concepts">Core Concepts</h3>
<ul>
<li><p><strong>Repository (Repo):</strong> A directory containing your project files and their complete revision history, either local or remote.</p>
</li>
<li><p><strong>Working Directory:</strong> Your everyday files where you edit code; changes here aren’t tracked until staged.<br />  Staging Area (Index): Intermediate zone where you select specific changes to prepare for a commit.</p>
</li>
<li><p><strong>Commit:</strong> A saved snapshot of staged changes with a unique ID and descriptive message, forming your project’s history.</p>
</li>
<li><p><strong>Branch:</strong> A lightweight pointer to a series of commits, letting you work on features independently from the main codebase.</p>
</li>
<li><p><strong>HEAD:</strong> Points to the current commit or branch you’re on, moving forward as you commit.</p>
</li>
</ul>
<h3 id="heading-basic-workflow">Basic Workflow</h3>
<p>Start with an empty folder for your project.</p>
<ul>
<li><p>Initialize:  <code>git init</code>  creates a new repo with a  <code>.git</code>  folder.</p>
</li>
<li><p>Check status:  <code>git status</code>  shows modified, staged, or untracked files.</p>
</li>
<li><p>Stage changes:  <code>git add filename.txt</code>  (or  <code>git add .</code>  for all) moves files to staging.</p>
</li>
<li><p>Commit:  <code>git commit -m "Initial project setup"</code> saves the snapshot.</p>
</li>
<li><p>View history:  <code>git log</code>  displays commits with IDs, authors, and messages.</p>
</li>
<li><p>Create branch:  <code>git branch feature-x</code>  then  <code>git checkout feature-x</code>  (or  <code>git switch feature-x</code> ) to work separately.</p>
</li>
<li><p>Merge: Switch to main ( <code>git checkout main</code> ), then  <code>git merge feature-x</code>  to combine.</p>
</li>
</ul>
<p>This workflow mirrors real development: edit in working directory → stage selectively → commit to repo → branch for features → merge when ready.</p>
<p><img src="https://media.geeksforgeeks.org/wp-content/uploads/20250710172654460719/What-is-Git-repository.webp" alt="Understanding Git Repository - GeeksforGeeks" /></p>
<h3 id="heading-common-commands">Common Commands</h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Command</strong></td><td><strong>Purpose</strong></td><td><strong>Example</strong></td></tr>
</thead>
<tbody>
<tr>
<td><code>git init</code></td><td>Start new repo</td><td><code>git init</code></td></tr>
<tr>
<td><code>git status</code></td><td>Check file states</td><td><code>git status</code></td></tr>
<tr>
<td><code>git add</code></td><td>Stage changes</td><td><code>git add .</code></td></tr>
<tr>
<td><code>git commit</code></td><td>Save snapshot</td><td><code>git commit -m "msg"</code></td></tr>
<tr>
<td><code>git log</code></td><td>View history</td><td><code>git log --oneline</code></td></tr>
<tr>
<td><code>git branch</code></td><td>List/manage branches</td><td><code>git branch -d old-branch</code></td></tr>
<tr>
<td><code>git checkout</code></td><td>Switch branches/commits</td><td><code>git checkout -b new-branch</code></td></tr>
</tbody>
</table>
</div><h3 id="heading-workflow-example">Workflow Example</h3>
<p>Start with ChaiCode portfolio/tutorial site:</p>
<p>1. Create folder  <code>chai-code</code>  and navigate:  cd <code>chai-code .</code><br />2. <code>git init</code>  – Initializes repo for your ChaiCode project.<br />3. Add files: Create  <code>index.html</code>  (homepage),  <code>app.js</code>  (basic JS logic),  styles.css .<br />4. Check:  <code>git status</code>  reveals untracked files in your ChaiCode directory.<br />5. Stage selectively:  <code>git add index.html app.js</code>  (skip CSS for now).<br />6. Commit:  <code>git commit -m "Initial ChaiCode homepage and JS"</code> .<br />7. Iterate: Edit  <code>app.js</code>  to add a “Brew Code” button function, then  <code>git add app.js</code> ,  <code>git commit -m "Add interactive brewing feature"</code> .<br />8. History:  <code>git log --oneline</code>  shows clean ChaiCode evolution like  <code>e4f5g6 (HEAD -&gt; main) Add brewing feature</code> .</p>
<p><img src="https://www.develer.com/wp-content/uploads/2021/08/image-9.png" alt="Git: How to Write Commits and Why" /></p>
]]></content:encoded></item></channel></rss>