<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Harsh</title>
    <description>The latest articles on Forem by Harsh (@dark-lord-harsh).</description>
    <link>https://forem.com/dark-lord-harsh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3683185%2F7fd99a85-4d5b-4226-af69-bd60dad80016.jpg</url>
      <title>Forem: Harsh</title>
      <link>https://forem.com/dark-lord-harsh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/dark-lord-harsh"/>
    <language>en</language>
    <item>
      <title>Getting Started with cURL</title>
      <dc:creator>Harsh</dc:creator>
      <pubDate>Fri, 30 Jan 2026 19:29:53 +0000</pubDate>
      <link>https://forem.com/dark-lord-harsh/getting-started-with-curl-20fp</link>
      <guid>https://forem.com/dark-lord-harsh/getting-started-with-curl-20fp</guid>
      <description>&lt;p&gt;If you’re learning programming, web development, or APIs, you’ll hear the word cURL a lot. At first, it might feel intimidating strange commands, terminal windows, and servers you can’t see.&lt;/p&gt;

&lt;p&gt;Don’t worry. This guide will walk you through cURL step by step, using plain language and simple examples.&lt;/p&gt;

&lt;p&gt;By the end, you’ll understand what cURL is, why programmers use it, and how to make your first request with confidence.&lt;/p&gt;




&lt;h2&gt;
  
  
  First Things First: What Is a Server?
&lt;/h2&gt;

&lt;p&gt;Before we talk about cURL, let’s understand servers.&lt;/p&gt;

&lt;p&gt;A server is just a computer that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stores data&lt;/li&gt;
&lt;li&gt;Runs applications&lt;/li&gt;
&lt;li&gt;Responds when someone asks it for information&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whenever you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a website&lt;/li&gt;
&lt;li&gt;Log into an app&lt;/li&gt;
&lt;li&gt;Fetch data from an API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You are talking to a server.&lt;/p&gt;

&lt;p&gt;Your browser sends a message like:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“Hey server, can you send me this webpage?”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The server replies with:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“Sure, here you go.”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;That back-and-forth conversation is the foundation of the internet.&lt;/p&gt;

&lt;h2&gt;
  
  
  So Where Does cURL Fit In?
&lt;/h2&gt;

&lt;p&gt;Normally, your browser talks to servers for you.&lt;/p&gt;

&lt;p&gt;But what if you want to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test an API&lt;/li&gt;
&lt;li&gt;Fetch data without a browser&lt;/li&gt;
&lt;li&gt;Send requests directly from your terminal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s where cURL comes in.&lt;/p&gt;

&lt;p&gt;In very simple terms:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cURL is a tool that lets you send messages to a server from the terminal.&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Think of it like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Browser → sends requests automatically&lt;/li&gt;
&lt;li&gt;cURL → lets you send those requests manually&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FFyN_zLYk0hTxa_IYufXb745RYNQol9cWpGMRaVXm9io%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly90ZWNh%2FZG1pbi5uZXQvd3At%2FY29udGVudC91cGxv%2FYWRzLzIwMjIvMDkv%2FY3VybC1yZXF1ZXN0%2FLWhlYWRlcnMtYW5k%2FLXJlcG9uc2UtaGVh%2FZGVycy5wbmc" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FFyN_zLYk0hTxa_IYufXb745RYNQol9cWpGMRaVXm9io%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly90ZWNh%2FZG1pbi5uZXQvd3At%2FY29udGVudC91cGxv%2FYWRzLzIwMjIvMDkv%2FY3VybC1yZXF1ZXN0%2FLWhlYWRlcnMtYW5k%2FLXJlcG9uc2UtaGVh%2FZGVycy5wbmc" width="820" height="485"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Programmers Need cURL
&lt;/h2&gt;

&lt;p&gt;Programmers use cURL because it helps them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test APIs quickly&lt;/li&gt;
&lt;li&gt;Debug backend services&lt;/li&gt;
&lt;li&gt;See raw server responses&lt;/li&gt;
&lt;li&gt;Work without a browser&lt;/li&gt;
&lt;li&gt;Automate requests&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re doing backend development, cURL becomes a daily companion.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FaeZ7ufN5RwzDylkXybarWOSK2SLsPblRLNlMzFTMoGM%2Frs%3Afit%3A0%3A180%3A1%3A0%2Fg%3Ace%2FaHR0cHM6Ly9tZWRp%2FYTIuZGV2LnRvL2R5%2FbmFtaWMvaW1hZ2Uv%2Fd2lkdGg9ODAwLGhl%2FaWdodD0sZml0PXNj%2FYWxlLWRvd24sZ3Jh%2Fdml0eT1hdXRvLGZv%2Fcm1hdD1hdXRvL2h0%2FdHBzOi8vZGV2LXRv%2FLXVwbG9hZHMuczMu%2FYW1hem9uYXdzLmNv%2FbS91cGxvYWRzL2Fy%2FdGljbGVzLzNkb2xx%2FMXB5Ym15b3cycHA5%2FdDkyLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FaeZ7ufN5RwzDylkXybarWOSK2SLsPblRLNlMzFTMoGM%2Frs%3Afit%3A0%3A180%3A1%3A0%2Fg%3Ace%2FaHR0cHM6Ly9tZWRp%2FYTIuZGV2LnRvL2R5%2FbmFtaWMvaW1hZ2Uv%2Fd2lkdGg9ODAwLGhl%2FaWdodD0sZml0PXNj%2FYWxlLWRvd24sZ3Jh%2Fdml0eT1hdXRvLGZv%2Fcm1hdD1hdXRvL2h0%2FdHBzOi8vZGV2LXRv%2FLXVwbG9hZHMuczMu%2FYW1hem9uYXdzLmNv%2FbS91cGxvYWRzL2Fy%2FdGljbGVzLzNkb2xx%2FMXB5Ym15b3cycHA5%2FdDkyLnBuZw" width="742" height="180"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Making Your First cURL Request
&lt;/h2&gt;

&lt;p&gt;Let’s start with the simplest possible command.&lt;/p&gt;

&lt;p&gt;Open your terminal and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You just:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sent a request to a server&lt;/li&gt;
&lt;li&gt;Asked for a webpage&lt;/li&gt;
&lt;li&gt;Received a response&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What Just Happened Behind the Scenes?
&lt;/h2&gt;

&lt;p&gt;When you ran that command, cURL did three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sent a request to the server&lt;/li&gt;
&lt;li&gt;The server processed it&lt;/li&gt;
&lt;li&gt;The server sent back a response&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is how almost all web communication works.&lt;/p&gt;

&lt;p&gt;No flags. No complexity. Just confidence.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FYiGJkgvJvSG--r9tQINtQBtIaOOuFLByF18LA7nDhuc%2Frs%3Afit%3A0%3A180%3A1%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2FZW5hYmxlZ2Vlay5j%2Fb20vd3AtY29udGVu%2FdC91cGxvYWRzLzIw%2FMjMvMDIvaW1hZ2Ut%2FMTQucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FYiGJkgvJvSG--r9tQINtQBtIaOOuFLByF18LA7nDhuc%2Frs%3Afit%3A0%3A180%3A1%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2FZW5hYmxlZ2Vlay5j%2Fb20vd3AtY29udGVu%2FdC91cGxvYWRzLzIw%2FMjMvMDIvaW1hZ2Ut%2FMTQucG5n" width="578" height="180"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding Request and Response
&lt;/h2&gt;

&lt;p&gt;The Request&lt;/p&gt;

&lt;p&gt;A request is simply:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What you want&lt;/li&gt;
&lt;li&gt;Where you want it from&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In our example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You wanted a webpage&lt;/li&gt;
&lt;li&gt;From example.com&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is called a GET request.&lt;/p&gt;

&lt;p&gt;The Response&lt;/p&gt;

&lt;p&gt;The response usually contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Status (Did it work?)&lt;/li&gt;
&lt;li&gt;Data (The content returned)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;200 OK → Success&lt;/li&gt;
&lt;li&gt;404 Not Found → Page doesn’t exist&lt;/li&gt;
&lt;li&gt;500 Server Error → Server had a problem&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The text you see printed in the terminal is the data returned by the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  GET and POST
&lt;/h2&gt;

&lt;p&gt;Let’s keep things simple.&lt;/p&gt;

&lt;p&gt;GET&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Used to get data&lt;/li&gt;
&lt;li&gt;You’ve already used it&lt;/li&gt;
&lt;li&gt;Default method in cURL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.example.com/users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;POST&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Used to send data to a server&lt;/li&gt;
&lt;li&gt;Common when submitting forms or creating data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X POST https://api.example.com/users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don’t worry about the details yet, just remember:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GET = ask for data&lt;/li&gt;
&lt;li&gt;POST = send data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s enough for now &lt;/p&gt;

&lt;h2&gt;
  
  
  Using cURL to Talk to APIs
&lt;/h2&gt;

&lt;p&gt;APIs are just servers that speak in data instead of webpages.&lt;/p&gt;

&lt;p&gt;When you use cURL with an API, you might:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetch user information&lt;/li&gt;
&lt;li&gt;Create new records&lt;/li&gt;
&lt;li&gt;Test endpoints before writing code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl https://api.example.com/products
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The server might respond with JSON instead of HTML and that’s totally normal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FhqN_f0fmldTWah7NBWCyLCwDGfXkwZIVwkQEjMLMXaM%2Frs%3Afit%3A0%3A180%3A1%3A0%2Fg%3Ace%2FaHR0cHM6Ly9tZWRp%2FYTIuZGV2LnRvL2R5%2FbmFtaWMvaW1hZ2Uv%2Fd2lkdGg9ODAwLGhl%2FaWdodD0sZml0PXNj%2FYWxlLWRvd24sZ3Jh%2Fdml0eT1hdXRvLGZv%2Fcm1hdD1hdXRvL2h0%2FdHBzOi8vZGV2LXRv%2FLXVwbG9hZHMuczMu%2FYW1hem9uYXdzLmNv%2FbS91cGxvYWRzL2Fy%2FdGljbGVzLzBsazZt%2FbHlqNDVzbTczMzN4%2FNGEzLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FhqN_f0fmldTWah7NBWCyLCwDGfXkwZIVwkQEjMLMXaM%2Frs%3Afit%3A0%3A180%3A1%3A0%2Fg%3Ace%2FaHR0cHM6Ly9tZWRp%2FYTIuZGV2LnRvL2R5%2FbmFtaWMvaW1hZ2Uv%2Fd2lkdGg9ODAwLGhl%2FaWdodD0sZml0PXNj%2FYWxlLWRvd24sZ3Jh%2Fdml0eT1hdXRvLGZv%2Fcm1hdD1hdXRvL2h0%2FdHBzOi8vZGV2LXRv%2FLXVwbG9hZHMuczMu%2FYW1hem9uYXdzLmNv%2FbS91cGxvYWRzL2Fy%2FdGljbGVzLzBsazZt%2FbHlqNDVzbTczMzN4%2FNGEzLnBuZw" width="842" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FlLnGsCOIViHVxSNgSVZ9uvkPeSH3pNXfdfOO41BQmrY%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9tZWRp%2FYS5icmlnaHRkYXRh%2FLmNvbS8yMDI0LzA4%2FL2N1cmwtR0VULXJl%2FcXVlc3Qtb3V0cHV0%2FLXByZXR0aWZpZWQu%2FcG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FlLnGsCOIViHVxSNgSVZ9uvkPeSH3pNXfdfOO41BQmrY%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9tZWRp%2FYS5icmlnaHRkYXRh%2FLmNvbS8yMDI0LzA4%2FL2N1cmwtR0VULXJl%2FcXVlc3Qtb3V0cHV0%2FLXByZXR0aWZpZWQu%2FcG5n" width="860" height="575"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Common Mistakes Beginners Make with cURL
&lt;/h2&gt;

&lt;p&gt;You’re not alone if you hit these early on:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Overusing Flags Too Early
&lt;/h3&gt;

&lt;p&gt;cURL has many options, but beginners don’t need most of them.&lt;br&gt;
Start simple. Add complexity later.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Forgetting the URL
&lt;/h3&gt;

&lt;p&gt;Yes, it happens&lt;br&gt;
cURL always needs a destination.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Confusing GET and POST
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;GET → retrieve&lt;/li&gt;
&lt;li&gt;POST → send&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Panicking Over Ugly Output
&lt;/h3&gt;

&lt;p&gt;Raw responses aren’t always pretty.&lt;br&gt;
That doesn’t mean something is broken.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Expecting a Browser-Like Experience
&lt;/h3&gt;

&lt;p&gt;cURL shows data, not design.&lt;br&gt;
No colors, no layout just the truth.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;cURL isn’t scary, it’s honest.&lt;/p&gt;

&lt;p&gt;It shows you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Exactly what you send&lt;/li&gt;
&lt;li&gt;Exactly what the server returns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start small. Stay curious. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FZNhUATP-oa96j-t3GbbOdwE64wUWTfqZqIP2gBKBwP4%2Frs%3Afit%3A500%3A0%3A1%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pLnBy%2Fb2dyYW1tZXJodW1v%2Fci5pby8yMDI1LzA3%2FLzBjOWU1YjE5M2Uy%2FN2YxZjYyYTAzZTRk%2FMjdjMTViMWQyZDdh%2FOGU4NTFiODI2OGIx%2FY2VhNzU5OTRjOTlm%2FZDJmYTEuanBlZw" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FZNhUATP-oa96j-t3GbbOdwE64wUWTfqZqIP2gBKBwP4%2Frs%3Afit%3A500%3A0%3A1%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pLnBy%2Fb2dyYW1tZXJodW1v%2Fci5pby8yMDI1LzA3%2FLzBjOWU1YjE5M2Uy%2FN2YxZjYyYTAzZTRk%2FMjdjMTViMWQyZDdh%2FOGU4NTFiODI2OGIx%2FY2VhNzU5OTRjOTlm%2FZDJmYTEuanBlZw" width="500" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>webdev</category>
      <category>networking</category>
      <category>sre</category>
    </item>
    <item>
      <title>DNS Record Types Explained</title>
      <dc:creator>Harsh</dc:creator>
      <pubDate>Fri, 30 Jan 2026 18:33:44 +0000</pubDate>
      <link>https://forem.com/dark-lord-harsh/dns-record-types-explained-8hf</link>
      <guid>https://forem.com/dark-lord-harsh/dns-record-types-explained-8hf</guid>
      <description>&lt;h2&gt;
  
  
  How does a browser know where a website lives?
&lt;/h2&gt;

&lt;p&gt;When you type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;www.google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;into your browser, your computer somehow finds the exact machine in the world that runs Google’s website.&lt;/p&gt;

&lt;p&gt;But computers don’t understand names like google.com.&lt;/p&gt;

&lt;p&gt;They only understand IP addresses, such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;142.250.195.78
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the real question becomes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does a human-friendly name turn into a machine-friendly address?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That’s where DNS comes in.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is DNS?
&lt;/h2&gt;

&lt;p&gt;DNS stands for Domain Name System.&lt;br&gt;
DNS is basically the phonebook of the internet.&lt;/p&gt;

&lt;p&gt;Similar as &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You search a person’s name → get their phone number&lt;/li&gt;
&lt;li&gt;The browser searches a domain name → gets an IP address&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without DNS, you would have to remember numbers instead of names:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;142.250.195.78 instead of google.com 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DNS makes the internet usable for humans.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2Fbz3gHs6qR7-VBysFQRQJSJk_wdjsmWLRO6i-Sc1UHJc%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2FZWR1Y2F0aXZlLmlv%2FL2FwaS9jb2xsZWN0%2FaW9uLzEwMzcwMDAx%2FLzQ5NDE0MjkzMzUz%2FOTIyNTYvcGFnZS81%2FNzI4NjE5MjA0MTgy%2FMDE2L2ltYWdlLzUx%2FMjMwNTE4MjA1NDgw%2FOTY_cGFnZV90eXBl%2FPWNvbGxlY3Rpb25f%2FbGVzc29uJmdldF9v%2FcHRpbWlzZWQ9dHJ1%2FZSZjb2xsZWN0aW9u%2FX3Rva2VuPXVuZGVm%2FaW5lZA" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2Fbz3gHs6qR7-VBysFQRQJSJk_wdjsmWLRO6i-Sc1UHJc%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2FZWR1Y2F0aXZlLmlv%2FL2FwaS9jb2xsZWN0%2FaW9uLzEwMzcwMDAx%2FLzQ5NDE0MjkzMzUz%2FOTIyNTYvcGFnZS81%2FNzI4NjE5MjA0MTgy%2FMDE2L2ltYWdlLzUx%2FMjMwNTE4MjA1NDgw%2FOTY_cGFnZV90eXBl%2FPWNvbGxlY3Rpb25f%2FbGVzc29uJmdldF9v%2FcHRpbWlzZWQ9dHJ1%2FZSZjb2xsZWN0aW9u%2FX3Rva2VuPXVuZGVm%2FaW5lZA" alt="Browser → DNS → Server high-level flow diagram" width="860" height="1010"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why are DNS records needed?
&lt;/h2&gt;

&lt;p&gt;A domain name doesn’t store information by itself.&lt;br&gt;
DNS records are the instructions attached to a domain.&lt;br&gt;
They answer questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Who controls this domain?&lt;/li&gt;
&lt;li&gt;Where is the website hosed?&lt;/li&gt;
&lt;li&gt;Where should emails go?&lt;/li&gt;
&lt;li&gt;Is this domain verified for some service?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each DNS record solves one specific problem.&lt;br&gt;
Instead of one giant setting, DNS uses different record types, each with a clear job.&lt;/p&gt;


&lt;h2&gt;
  
  
  What is an NS Record?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;NS = Name Server&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;NS records tell the internet:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“These servers are responsible for this domain.”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Think of NS records like the main office of a society that knows where every house is.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example.com → ns1.cloudflare.com
               ns2.cloudflare.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means Cloudflare’s servers manage all DNS information for example.com.&lt;/p&gt;

&lt;p&gt;Without NS records, no one would know where to even ask about your domain.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FiLSaMSkBxh_lokH-IIf3d1E1MVlJkpmaPVAMXzFiawc%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pbWFn%2FZXMzLm1lbWVkcm9p%2FZC5jb20vaW1hZ2Vz%2FL1VQTE9BREVEMTk3%2FLzY5MWViZWQ4OTBk%2FYmUuanBlZw" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FiLSaMSkBxh_lokH-IIf3d1E1MVlJkpmaPVAMXzFiawc%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pbWFn%2FZXMzLm1lbWVkcm9p%2FZC5jb20vaW1hZ2Vz%2FL1VQTE9BREVEMTk3%2FLzY5MWViZWQ4OTBk%2FYmUuanBlZw" alt="meme related to cloud flare" width="460" height="382"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What is an A Record?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A = Address&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An A record connects a domain name to an IPv4 address.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example.com → 93.184.216.34
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells the browser:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“The website lives on this machine.”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Think of it like a house address.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Domain name = person&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;IP address = house location&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FjJkfBjrdM9_swEcUbyk9cAC2f6lelWfPIdoS4rfIBT8%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2Fc2VydmVycy5jb20v%2FZEEvZGQyMzkxNTQ2%2FYS9pbWFnZS9ob3ct%2FdG8tcG9pbnQteW91%2Fci1kb21haW4tbmFt%2FZS10by1kZWRpY2F0%2FZWQtc2VydmVycy1p%2FcC1hZGRyZXNzLTE3%2FLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FjJkfBjrdM9_swEcUbyk9cAC2f6lelWfPIdoS4rfIBT8%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2Fc2VydmVycy5jb20v%2FZEEvZGQyMzkxNTQ2%2FYS9pbWFnZS9ob3ct%2FdG8tcG9pbnQteW91%2Fci1kb21haW4tbmFt%2FZS10by1kZWRpY2F0%2FZWQtc2VydmVycy1p%2FcC1hZGRyZXNzLTE3%2FLnBuZw" width="860" height="440"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  What is an AAAA Record?
&lt;/h2&gt;

&lt;p&gt;AAAA records do the same job as A records but for IPv6 addresses (the newer, longer IP format).&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example.com → 2606:2800:220:1:248:1893:25c8:1946
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why both exist?&lt;/p&gt;

&lt;p&gt;Because the internet is slowly moving from IPv4 → IPv6.&lt;/p&gt;

&lt;p&gt;Many websites use both A and AAAA records so all networks can reach them.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is a CNAME Record?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CNAME = Canonical Name&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A CNAME record points one domain name to another domain name.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;www.example.com → example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So instead of storing an IP address, it says:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“Go ask that domain instead.”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This is very useful when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;multiple names should lead to the same site&lt;/li&gt;
&lt;li&gt;the main domain’s IP changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of CNAME like a contact saved under another contact.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FxqJJcWiWc4wlm_JkLu1VjOvSZPSn2xDtME7DrppgyRk%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9oZWxw%2FLm9uZS5jb20vaGMv%2FYXJ0aWNsZV9hdHRh%2FY2htZW50cy8yNzkx%2FNzUyODMwMDE3Nw" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FxqJJcWiWc4wlm_JkLu1VjOvSZPSn2xDtME7DrppgyRk%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9oZWxw%2FLm9uZS5jb20vaGMv%2FYXJ0aWNsZV9hdHRh%2FY2htZW50cy8yNzkx%2FNzUyODMwMDE3Nw" width="720" height="485"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What is an MX Record?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;MX = Mail Exchange&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;MX records tell the internet:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“Emails for this domain should go here.”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example.com → mail.google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When someone sends:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hello@example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MX records guide that email to the correct mail server.&lt;/p&gt;

&lt;p&gt;Important:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Websites use A / CNAME&lt;/li&gt;
&lt;li&gt;Emails use MX&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They solve totally different problems.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2F5oNDmGRpWr3ercU1PbpczvtFqis3g2krGpc7fUVic0s%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2FcHJhY3RpY2FsMzY1%2FLmNvbS93cC1jb250%2FZW50L3VwbG9hZHMv%2FMjAxMi8xMS9lc3Bt%2FeDEucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2F5oNDmGRpWr3ercU1PbpczvtFqis3g2krGpc7fUVic0s%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2FcHJhY3RpY2FsMzY1%2FLmNvbS93cC1jb250%2FZW50L3VwbG9hZHMv%2FMjAxMi8xMS9lc3Bt%2FeDEucG5n" width="462" height="132"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What is a TXT Record?
&lt;/h2&gt;

&lt;p&gt;TXT records store text-based information.&lt;br&gt;
They are commonly used for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Domain ownership verification&lt;/li&gt;
&lt;li&gt;Email security (SPF, DKIM, DMARC)&lt;/li&gt;
&lt;li&gt;Connecting domains to services (GitHub, Google, Cloudflare, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"google-site-verification=abc123"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Think of TXT records as note papers attached to your domain.&lt;br&gt;
They don’t move traffic, they prove trust and provide info.&lt;/p&gt;




&lt;h2&gt;
  
  
  How all DNS records work together for one website
&lt;/h2&gt;

&lt;p&gt;Let’s say you run a small website: myblog.com&lt;/p&gt;

&lt;p&gt;Behind the scenes, DNS might look like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NS → who manages the domain&lt;/li&gt;
&lt;li&gt;A / AAAA → where the website lives&lt;/li&gt;
&lt;li&gt;CNAME → connect subdomains&lt;/li&gt;
&lt;li&gt;MX → where emails go&lt;/li&gt;
&lt;li&gt;TXT → verification &amp;amp; security&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All records work together like departments in a company.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;A Record vs CNAME&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Record → points to an IP&lt;/li&gt;
&lt;li&gt;CNAME → points to another name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A = final house&lt;br&gt;
CNAME = redirect board&lt;/p&gt;

&lt;p&gt;NS vs MX&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NS → who controls the domain&lt;/li&gt;
&lt;li&gt;MX → who handles emails&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NS is about DNS authority&lt;br&gt;
MX is about email delivery&lt;/p&gt;

&lt;p&gt;DNS is not one thing.&lt;br&gt;
It’s a collection of small instruction cards attached to your domain.&lt;/p&gt;

&lt;p&gt;Each card answers one clear question:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where is the site?&lt;/li&gt;
&lt;li&gt;Who manages this domain?&lt;/li&gt;
&lt;li&gt;Where should emails go?&lt;/li&gt;
&lt;li&gt;Is this domain verified?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you understand that DNS stops feeling scary and starts feeling logical.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FDFh1Cbp_vGgdAD2kab7fmvl88RF6PoWi8BxXxn5LeAo%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9iLnRo%2FdW1icy5yZWRkaXRt%2FZWRpYS5jb20vX0Nz%2FNjE1N2ZvbkFITVBE%2FNXNwS253RmZ3NjFR%2Fa2NLTmtiaHcxM2Zz%2FdVlOUS5qcGc" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FDFh1Cbp_vGgdAD2kab7fmvl88RF6PoWi8BxXxn5LeAo%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9iLnRo%2FdW1icy5yZWRkaXRt%2FZWRpYS5jb20vX0Nz%2FNjE1N2ZvbkFITVBE%2FNXNwS253RmZ3NjFR%2Fa2NLTmtiaHcxM2Zz%2FdVlOUS5qcGc" width="140" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>networking</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How DNS Resolution Works</title>
      <dc:creator>Harsh</dc:creator>
      <pubDate>Thu, 29 Jan 2026 03:39:47 +0000</pubDate>
      <link>https://forem.com/dark-lord-harsh/how-dns-resolution-works-2o3m</link>
      <guid>https://forem.com/dark-lord-harsh/how-dns-resolution-works-2o3m</guid>
      <description>&lt;p&gt;When you type &lt;code&gt;google.com&lt;/code&gt; into your browser and press Enter, you’re not actually connecting to “google.com”.&lt;/p&gt;

&lt;p&gt;You’re connecting to an &lt;strong&gt;IP address&lt;/strong&gt; like &lt;code&gt;142.250.77.46&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FCxbL5WQQy4-w0HWd3z-d8C1L7LlZHnNTbWatho_bQ20%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pbWFn%2FZXM3Lm1lbWVkcm9p%2FZC5jb20vaW1hZ2Vz%2FL1VQTE9BREVEODg5%2FLzY4Zjg5MTU3Yzk0%2FNmIuanBlZw" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FCxbL5WQQy4-w0HWd3z-d8C1L7LlZHnNTbWatho_bQ20%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pbWFn%2FZXM3Lm1lbWVkcm9p%2FZC5jb20vaW1hZ2Vz%2FL1VQTE9BREVEODg5%2FLzY4Zjg5MTU3Yzk0%2FNmIuanBlZw" alt="dns related meme" width="500" height="666"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So the real question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does the internet convert human-friendly names into machine-friendly IPs?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That system is called &lt;strong&gt;DNS (Domain Name System)&lt;/strong&gt; often described as &lt;em&gt;the internet’s phonebook&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This article walks step-by-step through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What DNS is and why it exists
&lt;/li&gt;
&lt;li&gt;How the &lt;code&gt;dig&lt;/code&gt; command helps us inspect DNS
&lt;/li&gt;
&lt;li&gt;Root, TLD, and authoritative name servers
&lt;/li&gt;
&lt;li&gt;The full DNS resolution flow for &lt;code&gt;google.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;How all of this connects to real browser requests
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And we’ll build everything logically using real &lt;code&gt;dig&lt;/code&gt; commands.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is DNS and why name resolution exists
&lt;/h2&gt;

&lt;p&gt;Computers don’t understand domain names.&lt;/p&gt;

&lt;p&gt;They communicate using &lt;strong&gt;IP addresses&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But humans don’t want to remember this: 142.250.77.46&lt;/p&gt;

&lt;p&gt;So DNS exists to answer one simple question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What is the IP address of this domain name?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example: google.com → 142.250.77.46&lt;/p&gt;

&lt;p&gt;DNS provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Human-readable names
&lt;/li&gt;
&lt;li&gt;Decentralized global database
&lt;/li&gt;
&lt;li&gt;Scalable and fault-tolerant name resolution
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without DNS, the modern web wouldn’t be usable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FrI1IDZbv2FxqoBebdmBZ-KcgeBfzCPlcN26x8V2vdiI%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9paDEu%2FcmVkYnViYmxlLm5l%2FdC9pbWFnZS40ODk3%2FOTUxMDI1Ljk5MDkv%2Fc3Qsc21hbGwsNTA3%2FeDUwNy1wYWQsNjAw%2FeDYwMCxmOGY4Zjgu%2FanBn" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FrI1IDZbv2FxqoBebdmBZ-KcgeBfzCPlcN26x8V2vdiI%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9paDEu%2FcmVkYnViYmxlLm5l%2FdC9pbWFnZS40ODk3%2FOTUxMDI1Ljk5MDkv%2Fc3Qsc21hbGwsNTA3%2FeDUwNy1wYWQsNjAw%2FeDYwMCxmOGY4Zjgu%2FanBn" alt="meme reference" width="600" height="600"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What is the &lt;code&gt;dig&lt;/code&gt; command and when it is used
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;dig&lt;/code&gt; (Domain Information Groper) is a &lt;strong&gt;DNS diagnostic tool&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It allows you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Query DNS servers directly
&lt;/li&gt;
&lt;li&gt;Inspect DNS records (A, NS, MX, TXT, etc.)
&lt;/li&gt;
&lt;li&gt;Debug DNS issues
&lt;/li&gt;
&lt;li&gt;Understand how name resolution actually works
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This doesn’t just give you an IP, it shows the entire DNS answer structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  DNS works in layers
&lt;/h2&gt;

&lt;p&gt;DNS is hierarchical&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FY6HeQzz2NrPjNOr-QD1kI48i8NOrN6jGKay-usxiUGY%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9tZWRp%2FYS5nZWVrc2Zvcmdl%2FZWtzLm9yZy93cC1j%2Fb250ZW50L3VwbG9h%2FZHMvMjAyNjAxMDUx%2FODAwMTg4MDI5MDkv%2FZG5zX2hpZXJhcmNo%2FeS53ZWJw" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FY6HeQzz2NrPjNOr-QD1kI48i8NOrN6jGKay-usxiUGY%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9tZWRp%2FYS5nZWVrc2Zvcmdl%2FZWtzLm9yZy93cC1j%2Fb250ZW50L3VwbG9h%2FZHMvMjAyNjAxMDUx%2FODAwMTg4MDI5MDkv%2FZG5zX2hpZXJhcmNo%2FeS53ZWJw" alt="dns hierarchical structure" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each layer doesn’t know the final answer.&lt;/p&gt;

&lt;p&gt;It only knows who to ask next.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding dig . NS → Root name servers
&lt;/h2&gt;

&lt;p&gt;Let’s start at the very top.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dig . NS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This asks:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“Who are the name servers for the root of DNS?”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;You’ll see servers like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;a.root-servers.net  
b.root-servers.net  
c.root-servers.net  
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are root name servers.&lt;/p&gt;

&lt;p&gt;They do NOT know the IP of google.com.&lt;/p&gt;

&lt;p&gt;They only know:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“Who manages .com?”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;“Who manages .org?”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Their job is to point you to TLD name servers.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding &lt;code&gt;dig com NS&lt;/code&gt; → TLD name servers
&lt;/h2&gt;

&lt;p&gt;Now let’s move one level down.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig com NS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This asks:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“Who manages the .com domain?”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The response returns name servers operated by companies like Verisign.&lt;/p&gt;

&lt;p&gt;These TLD servers don’t know Google’s IP either.&lt;/p&gt;

&lt;p&gt;They only know:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“Who is authoritative for google.com?”&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;So they return the authoritative name servers for google.com.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding &lt;code&gt;dig google.com NS&lt;/code&gt; → Authoritative name servers
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig google.com NS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This returns servers like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ns1.google.com  
ns2.google.com  
ns3.google.com  
ns4.google.com  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are authoritative name servers.&lt;/p&gt;

&lt;p&gt;This is where truth lives.&lt;/p&gt;

&lt;p&gt;They store the real DNS records:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A (IP address)&lt;/li&gt;
&lt;li&gt;MX (mail servers)&lt;/li&gt;
&lt;li&gt;TXT (verification, SPF, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want the actual IP of google.com, this is where it comes from.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding &lt;code&gt;dig google.com&lt;/code&gt; → Full DNS resolution
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’ll see something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;google.com.   300   IN   A   142.250.77.46
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Behind the scenes (if uncached), the resolver performed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ask root → who handles .com?&lt;/li&gt;
&lt;li&gt;Ask TLD → who handles google.com?&lt;/li&gt;
&lt;li&gt;Ask authoritative → what is the IP?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your system’s recursive resolver did all this work for you.&lt;/p&gt;




&lt;h2&gt;
  
  
  What NS records really represent
&lt;/h2&gt;

&lt;p&gt;NS records don’t map names to IPs.&lt;/p&gt;

&lt;p&gt;They map names to name servers responsible for that zone.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;google.com → ns1.google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They define ownership and delegation.&lt;/p&gt;

&lt;p&gt;This is how DNS stays:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decentralized&lt;/li&gt;
&lt;li&gt;Scalable&lt;/li&gt;
&lt;li&gt;Company-controlled&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Google controls its DNS.&lt;br&gt;
You control yours.&lt;/p&gt;

&lt;p&gt;The root doesn’t control Google.&lt;/p&gt;

&lt;p&gt;What your recursive resolver actually does&lt;/p&gt;

&lt;p&gt;Your computer usually talks to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ISP DNS&lt;/li&gt;
&lt;li&gt;Router DNS&lt;/li&gt;
&lt;li&gt;Public DNS (8.8.8.8, 1.1.1.1)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are recursive resolvers.&lt;/p&gt;

&lt;p&gt;They You ask one question:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Query root servers&lt;/li&gt;
&lt;li&gt;Query TLD servers&lt;/li&gt;
&lt;li&gt;Query authoritative servers&lt;/li&gt;
&lt;li&gt;Cache results&lt;/li&gt;
&lt;li&gt;Protect you from complexity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They perform the entire DNS walk.&lt;/p&gt;


&lt;h2&gt;
  
  
  How this connects to real browser requests
&lt;/h2&gt;

&lt;p&gt;When you visit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;https://www.google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your browser:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Asks OS for IP&lt;/li&gt;
&lt;li&gt;OS asks recursive resolver&lt;/li&gt;
&lt;li&gt;Resolver walks DNS&lt;/li&gt;
&lt;li&gt;Gets IP&lt;/li&gt;
&lt;li&gt;Browser opens TCP connection&lt;/li&gt;
&lt;li&gt;TLS handshake starts&lt;/li&gt;
&lt;li&gt;HTTP request is sent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FafgJujh2paR0udUbyJ5o9KcoGf2qmj3R1aTtPx44c7s%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2FZmlyZXdhbGwuY3gv%2FaW1hZ2VzL3N0b3Jp%2FZXMvZG5zLXJlc29s%2FdXRpb24tMS5naWY.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FafgJujh2paR0udUbyJ5o9KcoGf2qmj3R1aTtPx44c7s%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2FZmlyZXdhbGwuY3gv%2FaW1hZ2VzL3N0b3Jp%2FZXMvZG5zLXJlc29s%2FdXRpb24tMS5naWY.gif" alt="Step-by-step DNS resolution" width="524" height="496"&gt;&lt;/a&gt;&lt;br&gt;
No DNS = No website.&lt;br&gt;
Every API call, cloud service, CDN, and microservice starts with DNS.&lt;/p&gt;




&lt;h2&gt;
  
  
  Mapping dig to DNS lookup stages
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;| Command           | What it represents    |
| ----------------- | --------------------- |
| dig . NS          | Root name servers     |
| dig com NS        | TLD name servers      |
| dig google.com NS | Authoritative servers |
| dig google.com    | Final resolution      |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each command reveals one layer of the system.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2F3N-dhWwjLovDuVAJfblrYbHh8TKPH72jNxWejw4jD3Y%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pLmlt%2FZ2ZsaXAuY29tLzI4%2FMGR6OS5qcGc" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2F3N-dhWwjLovDuVAJfblrYbHh8TKPH72jNxWejw4jD3Y%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pLmlt%2FZ2ZsaXAuY29tLzI4%2FMGR6OS5qcGc" width="500" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>networking</category>
      <category>network</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Understanding Network Devices</title>
      <dc:creator>Harsh</dc:creator>
      <pubDate>Mon, 26 Jan 2026 08:59:03 +0000</pubDate>
      <link>https://forem.com/dark-lord-harsh/understanding-network-devices-23pd</link>
      <guid>https://forem.com/dark-lord-harsh/understanding-network-devices-23pd</guid>
      <description>&lt;p&gt;From cables and signals to scalable backend systems a beginner friendly, hardware focused guide for developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does the Internet actually reach your laptop?
&lt;/h2&gt;

&lt;p&gt;When you open a website, data travels across multiple networking devices before it reaches your system.&lt;br&gt;
Your request doesn’t go straight to Google, GitHub, or your backend server.&lt;/p&gt;

&lt;p&gt;It flows through devices like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modem&lt;/li&gt;
&lt;li&gt;Router&lt;/li&gt;
&lt;li&gt;Switch&lt;/li&gt;
&lt;li&gt;Firewall&lt;/li&gt;
&lt;li&gt;Load balancer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each one has one clear responsibility, and together they build the foundation of the internet.&lt;/p&gt;

&lt;p&gt;But before deep diving into these networking device we need to understand what is a network, what is the term networking actual mean, how it get started and what are it impacts.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is a Network and How Does It Work?
&lt;/h2&gt;

&lt;p&gt;A network is simply, Two or more devices connected to share some data.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Home Wi-Fi&lt;/li&gt;
&lt;li&gt;Office LAN&lt;/li&gt;
&lt;li&gt;Data center network&lt;/li&gt;
&lt;li&gt;The Internet (largest network in the world)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Basic working principle
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Data is broken into small packets&lt;/li&gt;
&lt;li&gt;Each packet has:

&lt;ul&gt;
&lt;li&gt;Source address&lt;/li&gt;
&lt;li&gt;Destination address&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Networking devices forward these packets&lt;/li&gt;
&lt;li&gt;The destination device reassembles them&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  A quick history
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;1960s – ARPANET (military &amp;amp; universities)&lt;/li&gt;
&lt;li&gt;1980s – TCP/IP standard&lt;/li&gt;
&lt;li&gt;1990s – World Wide Web&lt;/li&gt;
&lt;li&gt;2000s–now – Cloud, mobile internet, global data centers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Today’s internet is a massive collection of interconnected private networks.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FaHaWeLmNt4G4Ta1aVEq_qjXwKrLZr-ORVwoPSgnNzHU%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9zdGF0%2FaWNzLm15bGFuZGlu%2FZ3BhZ2VzLmNvL3N0%2FYXRpYy9hYWFweWNt%2FMjJxbXVhYjQ0L2lt%2FYWdlLzdkOTFmZmE2%2FZWUzMjQxZGRhMWQz%2FNWQ3ZDFjZDIwNzYy%2FLndlYnA" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FaHaWeLmNt4G4Ta1aVEq_qjXwKrLZr-ORVwoPSgnNzHU%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9zdGF0%2FaWNzLm15bGFuZGlu%2FZ3BhZ2VzLmNvL3N0%2FYXRpYy9hYWFweWNt%2FMjJxbXVhYjQ0L2lt%2FYWdlLzdkOTFmZmE2%2FZWUzMjQxZGRhMWQz%2FNWQ3ZDFjZDIwNzYy%2FLndlYnA" alt="data flow" width="860" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let me give you an analogy: think of this like a delivery system.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Internet = global highway&lt;/li&gt;
&lt;li&gt;Modem = translator&lt;/li&gt;
&lt;li&gt;Router = traffic police&lt;/li&gt;
&lt;li&gt;Switch = local post office&lt;/li&gt;
&lt;li&gt;Devices = houses&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let’s break each one down.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is a Modem?
&lt;/h2&gt;

&lt;p&gt;A modem connects your private network to your Internet Service Provider (ISP).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Modem = MODulator + DEModulator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What it actually does
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Converts ISP signals (fiber/coax/DSL) into digital data&lt;/li&gt;
&lt;li&gt;Converts your data back into ISP-compatible signals&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without a modem, your network is cut off from the internet.&lt;/p&gt;

&lt;h3&gt;
  
  
  Analogy
&lt;/h3&gt;

&lt;p&gt;The modem is a language translator between your home and your ISP.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FEtn_vpH8j14gCy51YZEt9DMLCDujtFBTmTQ3fbbL224%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly90aHVt%2FYnMuZHJlYW1zdGlt%2FZS5jb20vYi9lbGVj%2FdHJvbmljLWRldmlj%2FZS13aWZpLW1vZGVt%2FLXdoaXRlLWJhY2tn%2Fcm91bmQtYWktZ2Vu%2FZXJhdGVkLTMzMTk2%2FMjk0NS5qcGc" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FEtn_vpH8j14gCy51YZEt9DMLCDujtFBTmTQ3fbbL224%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly90aHVt%2FYnMuZHJlYW1zdGlt%2FZS5jb20vYi9lbGVj%2FdHJvbmljLWRldmlj%2FZS13aWZpLW1vZGVt%2FLXdoaXRlLWJhY2tn%2Fcm91bmQtYWktZ2Vu%2FZXJhdGVkLTMzMTk2%2FMjk0NS5qcGc" alt="modem device" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Router?
&lt;/h2&gt;

&lt;p&gt;A router directs traffic between networks.&lt;br&gt;
It decides:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Where should this packet go next?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Responsibilities&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Routes data between devices and the internet&lt;/li&gt;
&lt;li&gt;Assigns local IP addresses (DHCP)&lt;/li&gt;
&lt;li&gt;Separates private and public networks&lt;/li&gt;
&lt;li&gt;Often provides Wi-Fi&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Analogy
&lt;/h3&gt;

&lt;p&gt;The router is traffic police at an intersection.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FxC1UedTASCNBdmCABCzPiYH9oBMQWd7r83yrVqML6-w%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9jZG4u%2FbW9zLmNtcy5mdXR1%2FcmVjZG4ubmV0L2ti%2FblpyQVNZamUzQjZH%2FQXZoVFl1a1IuanBn" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FxC1UedTASCNBdmCABCzPiYH9oBMQWd7r83yrVqML6-w%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9jZG4u%2FbW9zLmNtcy5mdXR1%2FcmVjZG4ubmV0L2ti%2FblpyQVNZamUzQjZH%2FQXZoVFl1a1IuanBn" alt="router device" width="860" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Switch vs Hub: How Local Networks Actually Work
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Hub (old technology)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sends incoming data to every port&lt;/li&gt;
&lt;li&gt;No intelligence&lt;/li&gt;
&lt;li&gt;Slow and insecure&lt;/li&gt;
&lt;li&gt;Everyone hears everything.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Switch (modern networks)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sends data only to the target device&lt;/li&gt;
&lt;li&gt;Learns MAC addresses&lt;/li&gt;
&lt;li&gt;Fast and secure&lt;/li&gt;
&lt;li&gt;Delivers parcels to the correct house.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2F0TU36Cys-3scIHNan8hUOz9W3j6DWNvXlDaO5KOWRxY%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cDovL3d3dy5s%2FZWFybmFiaGkuY29t%2FL3dwLWNvbnRlbnQv%2FdXBsb2Fkcy8yMDE4%2FLzAyL2h1Yi12cy1z%2Fd2l0Y2guanBn" alt="hub vs switch difference" width="860" height="484"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Key difference
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hub&lt;/th&gt;
&lt;th&gt;Switch&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Broadcasts to all&lt;/td&gt;
&lt;td&gt;Sends to specific device&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No memory&lt;/td&gt;
&lt;td&gt;Maintains MAC table&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rarely used today&lt;/td&gt;
&lt;td&gt;Used everywhere&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What is a Firewall?
&lt;/h2&gt;

&lt;p&gt;A firewall is a security device that monitors and filters traffic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Responsibilities
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Allow or block connections&lt;/li&gt;
&lt;li&gt;Protect internal networks&lt;/li&gt;
&lt;li&gt;Enforce security rules&lt;/li&gt;
&lt;li&gt;Prevent unauthorized access&lt;/li&gt;
&lt;li&gt;Firewalls sit at network boundaries.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FI8xpWt0XBxZYoUHFD9Ow1K2PfIIuGmURqkf0L5i_IZE%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9hc3Nl%2FdHMuZW50ZXJwcmlz%2FZW5ldHdvcmtpbmdw%2FbGFuZXQuY29tL3Vw%2FbG9hZHMvMjAyMy8w%2FNC9maWd1cmVfYS1m%2FaXJld2FsbF9wbGFj%2FZW1lbnRfaW5fYV9u%2FZXR3b3JrLnBuZw" alt="firewalls place" width="860" height="482"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Analogy
&lt;/h3&gt;

&lt;p&gt;A firewall is a security gate with guards checking IDs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Load Balancer?
&lt;/h2&gt;

&lt;p&gt;A load balancer distributes traffic across multiple servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why it exists
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Prevents server overload&lt;/li&gt;
&lt;li&gt;Improves availability&lt;/li&gt;
&lt;li&gt;Enables horizontal scaling&lt;/li&gt;
&lt;li&gt;Enables zero-downtime deployments&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What it does
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Requests
      |
      v
+----------------+
| Load Balancer  |
+----------------+
   /      |      \
  v       v       v
Server 1  Server 2  Server 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Analogy
&lt;/h3&gt;

&lt;p&gt;A load balancer is a toll booth system sending cars to different lanes.&lt;/p&gt;

&lt;h2&gt;
  
  
  How These Devices Work Together (Real-World Setup)
&lt;/h2&gt;

&lt;p&gt;Home or small office&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Internet
   |
   v
Modem
   |
   v
Router (NAT, WiFi, DHCP)
   |
   v
Switch
   |
   v
Laptop / Phone / TV
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2F_NjHkL-L_SXJfGGPb0cE0BdxIRQXiImZ4i9S7gWl8lk%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2FMTAxY29tcHV0aW5n%2FLm5ldC93cC93cC1j%2Fb250ZW50L3VwbG9h%2FZHMvbmV0d29yay1k%2FZXNpZ24tdmlydHVh%2FbC1wcml2YXRlLW5l%2FdHdvcmstdnBuLnBu%2FZw" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2F_NjHkL-L_SXJfGGPb0cE0BdxIRQXiImZ4i9S7gWl8lk%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2FMTAxY29tcHV0aW5n%2FLm5ldC93cC93cC1j%2Fb250ZW50L3VwbG9h%2FZHMvbmV0d29yay1k%2FZXNpZ24tdmlydHVh%2FbC1wcml2YXRlLW5l%2FdHdvcmstdnBuLnBu%2FZw" alt="Home/office network architecture" width="800" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens when you open a website?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Modem receives ISP signal&lt;/li&gt;
&lt;li&gt;Router forwards request&lt;/li&gt;
&lt;li&gt;Firewall checks rules&lt;/li&gt;
&lt;li&gt;Load balancer selects a server&lt;/li&gt;
&lt;li&gt;Switch delivers packet&lt;/li&gt;
&lt;li&gt;Server responds&lt;/li&gt;
&lt;li&gt;Response flows back the same way&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Where These Devices Sit in System Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;| Device        | Layer             |
| ------------- | ----------------- |
| Modem         | ISP boundary      |
| Router        | Network routing   |
| Switch        | Local delivery    |
| Firewall      | Security layer    |
| Load balancer | Scalability layer |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These devices create the physical foundation on which all software systems run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Every HTTP request, API call, or database query travels across:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modems&lt;/li&gt;
&lt;li&gt;Routers&lt;/li&gt;
&lt;li&gt;Switches&lt;/li&gt;
&lt;li&gt;Firewalls&lt;/li&gt;
&lt;li&gt;Load balancers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They are the silent workers behind every application.&lt;br&gt;
Once you understand how packets move physically, system design becomes much clearer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FTRMGaIiU5zKlcfz5gDMnK9dEh3LjY1iOarYbOqAeG3A%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2Fc2lsaWNvbnJlcHVi%2FbGljLmNvbS93cC1j%2Fb250ZW50L3VwbG9h%2FZHMvMjAxNC8xMi9p%2FbWcvbmV0ZmxpeC5q%2FcGc" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FTRMGaIiU5zKlcfz5gDMnK9dEh3LjY1iOarYbOqAeG3A%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93d3cu%2Fc2lsaWNvbnJlcHVi%2FbGljLmNvbS93cC1j%2Fb250ZW50L3VwbG9h%2FZHMvMjAxNC8xMi9p%2FbWcvbmV0ZmxpeC5q%2FcGc" width="311" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>network</category>
      <category>webdev</category>
      <category>networking</category>
      <category>programming</category>
    </item>
    <item>
      <title>Inside Git: How It Works and the Role of the .git Folder</title>
      <dc:creator>Harsh</dc:creator>
      <pubDate>Mon, 05 Jan 2026 18:25:38 +0000</pubDate>
      <link>https://forem.com/dark-lord-harsh/inside-git-how-it-works-and-the-role-of-the-git-folder-2ho1</link>
      <guid>https://forem.com/dark-lord-harsh/inside-git-how-it-works-and-the-role-of-the-git-folder-2ho1</guid>
      <description>&lt;p&gt;Most beginners learn Git by memorizing commands like &lt;code&gt;git add&lt;/code&gt;, &lt;code&gt;git commit&lt;/code&gt;, and &lt;code&gt;git push&lt;/code&gt;. But sooner or later, questions arise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where does Git actually store my code?&lt;/li&gt;
&lt;li&gt;What is the mysterious &lt;code&gt;.git&lt;/code&gt; folder?&lt;/li&gt;
&lt;li&gt;How does Git know what changed?&lt;/li&gt;
&lt;li&gt;Why does Git talk so much about hashes?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  In this article, we'll &lt;strong&gt;open Git's black box&lt;/strong&gt; and understand &lt;strong&gt;how Git works internally&lt;/strong&gt; in simple terms. No advanced theory. No magic. Just a clear mental model. 
&lt;/h2&gt;

&lt;h2&gt;
  
  
  How Git Works Internally (Big Picture)
&lt;/h2&gt;

&lt;p&gt;At its core, &lt;strong&gt;Git is a content addressable database&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That sounds complicated, but here's the simple idea:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Git doesn't track files it tracks snapshots of content.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every time you commit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git takes a snapshot of your project&lt;/li&gt;
&lt;li&gt;Stores it safely&lt;/li&gt;
&lt;li&gt;Links it to previous snapshots&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of this data lives inside &lt;strong&gt;one folder&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.git/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you understand this folder, you understand Git.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is the &lt;code&gt;.git&lt;/code&gt; Folder and Why Does It Exist?
&lt;/h2&gt;

&lt;p&gt;When you run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git creates a hidden folder called &lt;code&gt;.git&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This folder is &lt;strong&gt;the repository&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you delete &lt;code&gt;.git&lt;/code&gt;, your project becomes a normal folder Git history is gone.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  What does &lt;code&gt;.git&lt;/code&gt; contain?
&lt;/h3&gt;

&lt;p&gt;A simplified view:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.git/
├── objects/
├── refs/
├── HEAD
├── index
└── config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't panic we'll focus only on what matters.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why does Git need this folder?
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;.git&lt;/code&gt; folder stores:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your &lt;strong&gt;entire commit history&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;All &lt;strong&gt;versions of every file&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Branch information&lt;/li&gt;
&lt;li&gt;Metadata about commits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your working directory is just a &lt;strong&gt;checkout&lt;/strong&gt; of what's inside &lt;code&gt;.git&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Git Objects: Blob, Tree, Commit (The Building Blocks)
&lt;/h2&gt;

&lt;p&gt;Git stores everything as &lt;strong&gt;objects&lt;/strong&gt;. There are only &lt;strong&gt;three core object types&lt;/strong&gt; you need to understand.&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Fph1auhtknoz93x4xx27p.png" class="article-body-image-wrapper"&gt;&lt;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%2Fph1auhtknoz93x4xx27p.png" alt="Git Objects Diagram" width="800" height="594"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Blob: &lt;em&gt;File Content&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;blob&lt;/strong&gt; stores the &lt;strong&gt;contents of a file&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Important:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blob does &lt;strong&gt;not&lt;/strong&gt; store the filename&lt;/li&gt;
&lt;li&gt;Only the raw content&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log("Hello Git");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If two files have the &lt;strong&gt;same content&lt;/strong&gt;, Git stores &lt;strong&gt;only one blob&lt;/strong&gt;. This is how Git saves space.&lt;/p&gt;




&lt;h3&gt;
  
  
  Tree: &lt;em&gt;Folder Structure&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;tree&lt;/strong&gt; represents a directory.&lt;/p&gt;

&lt;p&gt;It:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maps filenames to blobs&lt;/li&gt;
&lt;li&gt;Can point to other trees (subfolders)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of a tree like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;project/
├── index.js (blob)
└── src/
    └── app.js (blob)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Trees tell Git:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which files exist&lt;/li&gt;
&lt;li&gt;Their names&lt;/li&gt;
&lt;li&gt;Their structure&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Commit: &lt;em&gt;A Snapshot&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;commit&lt;/strong&gt; is a snapshot of your project.&lt;/p&gt;

&lt;p&gt;It contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A reference to a &lt;strong&gt;tree&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A reference to the &lt;strong&gt;parent commit&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Author info&lt;/li&gt;
&lt;li&gt;Commit message&lt;/li&gt;
&lt;li&gt;Timestamp&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Visually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Commit
  ↓
 Tree
  ↓
Blobs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each commit links to the previous one, forming Git's history.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Git Tracks Changes (Not Diffs!)
&lt;/h2&gt;

&lt;p&gt;Many people think Git stores &lt;strong&gt;file differences&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It doesn't.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Git stores &lt;strong&gt;snapshots&lt;/strong&gt;, not diffs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When you commit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git checks each file&lt;/li&gt;
&lt;li&gt;If content is unchanged → reuse old blob&lt;/li&gt;
&lt;li&gt;If content changed → create new blob&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's why Git is fast and efficient.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Happens Internally During &lt;code&gt;git add&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;When you run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git does &lt;strong&gt;NOT&lt;/strong&gt; create a commit.&lt;/p&gt;

&lt;p&gt;Instead, it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reads the file content&lt;/li&gt;
&lt;li&gt;Creates a blob object&lt;/li&gt;
&lt;li&gt;Stores it in &lt;code&gt;.git/objects&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Updates the &lt;strong&gt;index&lt;/strong&gt; (staging area)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="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%2Fgs4gu72zudoc5ncgf7hc.png" class="article-body-image-wrapper"&gt;&lt;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%2Fgs4gu72zudoc5ncgf7hc.png" alt="Git Staging Area" width="800" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Mental model:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;git add&lt;/code&gt; = "Prepare this snapshot for the next commit"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The &lt;strong&gt;index&lt;/strong&gt; is a temporary holding area between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Working directory&lt;/li&gt;
&lt;li&gt;Repository history&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What Happens Internally During &lt;code&gt;git commit&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;When you run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"My commit"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Takes everything from the &lt;strong&gt;index&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Builds a &lt;strong&gt;tree&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Creates a &lt;strong&gt;commit object&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Updates &lt;code&gt;HEAD&lt;/code&gt; to point to the new commit&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;Your history is now permanently recorded (unless you rewrite it).&lt;/p&gt;




&lt;h2&gt;
  
  
  How Git Uses Hashes to Ensure Integrity
&lt;/h2&gt;

&lt;p&gt;Every Git object is identified by a &lt;strong&gt;SHA-1 hash&lt;/strong&gt; (40 characters).&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;e83c5163316f89bfbde7d9ab23ca2e25604af290
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why hashes matter
&lt;/h3&gt;

&lt;p&gt;Hashes ensure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Integrity&lt;/strong&gt; → content cannot be silently changed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Uniqueness&lt;/strong&gt; → same content = same hash&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt; → tampering breaks history&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If even &lt;strong&gt;one character changes&lt;/strong&gt;, the hash changes completely.&lt;/p&gt;

&lt;p&gt;This is why Git history is trustworthy.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2F5lmS1-eW4Hop4JnUS7aJHXrVS4-bmGY-6aP1DuAFuac%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pLnBy%2Fb2dyYW1tZXJodW1v%2Fci5pby8yMDIyLzAx%2FL3Byb2dyYW1tZXJo%2FdW1vci1pby1saW51%2FeC1tZW1lcy1iYWNr%2FZW5kLW1lbWVzLTEx%2FMDVlYThhZmRkNGMy%2FYS5qcGc" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2F5lmS1-eW4Hop4JnUS7aJHXrVS4-bmGY-6aP1DuAFuac%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pLnBy%2Fb2dyYW1tZXJodW1v%2Fci5pby8yMDIyLzAx%2FL3Byb2dyYW1tZXJo%2FdW1vci1pby1saW51%2FeC1tZW1lcy1iYWNr%2FZW5kLW1lbWVzLTEx%2FMDVlYThhZmRkNGMy%2FYS5qcGc" alt="Git Commit Meme" width="860" height="761"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;When you finally understand Git internals and realize commits are just pointers to trees&lt;/em&gt; &lt;/p&gt;


&lt;h2&gt;
  
  
  Building the Right Mental Model of Git
&lt;/h2&gt;

&lt;p&gt;Instead of memorizing commands, remember this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Git is a database of snapshots stored inside &lt;code&gt;.git&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.git&lt;/code&gt; = brain of Git&lt;/li&gt;
&lt;li&gt;Blob = file content&lt;/li&gt;
&lt;li&gt;Tree = folder structure&lt;/li&gt;
&lt;li&gt;Commit = snapshot + history&lt;/li&gt;
&lt;li&gt;Hash = identity + integrity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Commands like &lt;code&gt;add&lt;/code&gt;, &lt;code&gt;commit&lt;/code&gt;, and &lt;code&gt;checkout&lt;/code&gt; are just ways to &lt;strong&gt;move between snapshots&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Understanding Git internally:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Makes debugging easier&lt;/li&gt;
&lt;li&gt;Removes fear of "breaking Git"&lt;/li&gt;
&lt;li&gt;Helps you learn advanced topics faster&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You don't need to remember everything just remember &lt;strong&gt;how the pieces fit together&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you found this helpful, try exploring:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; .git/objects/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll be surprised how much Git suddenly makes sense.&lt;/p&gt;

</description>
      <category>git</category>
      <category>versioncontrol</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Git for Beginners: Basics and Essential Commands 🚀</title>
      <dc:creator>Harsh</dc:creator>
      <pubDate>Thu, 01 Jan 2026 18:44:08 +0000</pubDate>
      <link>https://forem.com/dark-lord-harsh/git-for-beginners-basics-and-essential-commands-4b49</link>
      <guid>https://forem.com/dark-lord-harsh/git-for-beginners-basics-and-essential-commands-4b49</guid>
      <description>&lt;p&gt;If you are starting your journey as a developer, you will hear the word &lt;strong&gt;Git&lt;/strong&gt; everywhere.&lt;/p&gt;

&lt;p&gt;Job descriptions mention it, open-source projects require it, and almost every team uses it daily.&lt;/p&gt;

&lt;p&gt;But what exactly is Git? And why is it so important?&lt;/p&gt;

&lt;p&gt;This article explains Git from scratch, in simple words, with beginner-friendly examples and commonly used commands.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1618401471353-b98afee0b2eb%3Fw%3D800%26h%3D400%26fit%3Dcrop" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1618401471353-b98afee0b2eb%3Fw%3D800%26h%3D400%26fit%3Dcrop" alt="Developer working with code" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📌 What is Git?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Git is a distributed version control system.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That sounds complex, so let's simplify it.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Git helps you track changes in your code over time.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It remembers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What&lt;/strong&gt; changed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When&lt;/strong&gt; it changed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Who&lt;/strong&gt; changed it&lt;/li&gt;
&lt;li&gt;And lets you &lt;strong&gt;go back to older versions&lt;/strong&gt; if something breaks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of Git like a &lt;strong&gt;time machine for your code&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of saving files like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;project_v1
project_v2
project_final
project_final_real
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git keeps everything organized and clean.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FuoLdgfD9KCy9UJ5V2-dVSITTOB_8vnWxFqwAxUPKllw%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9ibG9n%2FLmNvZGVpdGJyby5j%2Fb20vd3AtY29udGVu%2FdC91cGxvYWRzLzIw%2FMjUvMDgvZ2l0LXJl%2FbW90ZS1hZGQtb3Jp%2FZ2luLW1lbWUucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FuoLdgfD9KCy9UJ5V2-dVSITTOB_8vnWxFqwAxUPKllw%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9ibG9n%2FLmNvZGVpdGJyby5j%2Fb20vd3AtY29udGVu%2FdC91cGxvYWRzLzIw%2FMjUvMDgvZ2l0LXJl%2FbW90ZS1hZGQtb3Jp%2FZ2luLW1lbWUucG5n" alt="Git meme about file versions" width="600" height="908"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;We've all been there! Git saves us from this chaos.&lt;/em&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  🤔 Why Git is Used?
&lt;/h2&gt;

&lt;p&gt;Git is used because it solves many real problems developers face.&lt;/p&gt;
&lt;h3&gt;
  
  
  1️⃣ Track Code History
&lt;/h3&gt;

&lt;p&gt;You can see what changed and why it changed.&lt;/p&gt;
&lt;h3&gt;
  
  
  2️⃣ Work Without Fear
&lt;/h3&gt;

&lt;p&gt;Made a mistake? You can go back to a previous version easily.&lt;/p&gt;
&lt;h3&gt;
  
  
  3️⃣ Collaboration
&lt;/h3&gt;

&lt;p&gt;Multiple developers can work on the same project without overwriting each other's code.&lt;/p&gt;
&lt;h3&gt;
  
  
  4️⃣ Industry Standard
&lt;/h3&gt;

&lt;p&gt;Almost every company and open-source project uses Git with platforms like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;GitHub&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GitLab&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bitbucket&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;strong&gt;Learning Git is non-negotiable for developers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1522071820081-009f0129c71c%3Fw%3D800%26h%3D400%26fit%3Dcrop" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1522071820081-009f0129c71c%3Fw%3D800%26h%3D400%26fit%3Dcrop" alt="Team collaboration" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  🧠 Git Basics and Core Terminologies
&lt;/h2&gt;

&lt;p&gt;Before commands, let's understand the basic concepts.&lt;/p&gt;
&lt;h3&gt;
  
  
  📁 Repository (Repo)
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;repository&lt;/strong&gt; is a folder that Git tracks.&lt;/p&gt;

&lt;p&gt;It contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your project files&lt;/li&gt;
&lt;li&gt;Git's history and metadata&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You create it using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📦 Commit
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;commit&lt;/strong&gt; is a snapshot of your code at a specific point in time.&lt;/p&gt;

&lt;p&gt;Think of a commit as: &lt;strong&gt;"Save point with a message"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each commit has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A unique ID (hash)&lt;/li&gt;
&lt;li&gt;Author&lt;/li&gt;
&lt;li&gt;Date&lt;/li&gt;
&lt;li&gt;Message explaining the change&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🌿 Branch
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;branch&lt;/strong&gt; lets you work on features independently.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;main&lt;/code&gt; (or &lt;code&gt;master&lt;/code&gt;) → default branch&lt;/li&gt;
&lt;li&gt;Feature branches → new ideas or fixes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Branches help you experiment without breaking main code.&lt;/p&gt;

&lt;h3&gt;
  
  
  📍 HEAD
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;HEAD&lt;/strong&gt; points to your current position in Git history.&lt;/p&gt;

&lt;p&gt;Simply put: &lt;strong&gt;HEAD = "Where you are right now"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Usually, HEAD points to the latest commit of the current branch.&lt;/p&gt;




&lt;h2&gt;
  
  
  📊 Understanding Git Workflow
&lt;/h2&gt;

&lt;p&gt;Here's how Git organizes your work:&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Fxwxn5vv8e520rs0oujee.png" class="article-body-image-wrapper"&gt;&lt;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%2Fxwxn5vv8e520rs0oujee.png" alt="Git workflow diagram" width="686" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three main areas:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Working Directory&lt;/strong&gt; - Where you make changes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Staging Area&lt;/strong&gt; - Where you prepare changes for commit&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repository&lt;/strong&gt; - Where Git permanently stores commits&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🗂️ Git Repository Structure
&lt;/h2&gt;

&lt;p&gt;&lt;a href="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%2F925fjikl9gtvwjnyiyrl.png" class="article-body-image-wrapper"&gt;&lt;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%2F925fjikl9gtvwjnyiyrl.png" alt="Git repository structure" width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your local repository consists of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Working Directory&lt;/strong&gt;: Your actual project files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;.git folder&lt;/strong&gt;: All Git metadata and history&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remote Repository&lt;/strong&gt;: GitHub/GitLab (optional)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠 Common Git Commands (With Examples)
&lt;/h2&gt;

&lt;p&gt;Let's learn Git commands by actually using them.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 git init
&lt;/h3&gt;

&lt;p&gt;Initializes Git in your project folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 Creates a hidden &lt;code&gt;.git&lt;/code&gt; folder that Git uses to track everything.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 git status
&lt;/h3&gt;

&lt;p&gt;Shows the current state of your repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It tells you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which files are new&lt;/li&gt;
&lt;li&gt;Which files are modified&lt;/li&gt;
&lt;li&gt;What is staged for commit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;strong&gt;This is the most used Git command.&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 git add
&lt;/h3&gt;

&lt;p&gt;Adds files to the staging area.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add filename.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add everything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 Staging means &lt;strong&gt;"I want to include this in the next commit"&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 git commit
&lt;/h3&gt;

&lt;p&gt;Creates a snapshot of staged changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add initial project files"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✔️ &lt;strong&gt;Always write clear and meaningful messages.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;❌ Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"changes"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add login page UI"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🔹 git log
&lt;/h3&gt;

&lt;p&gt;Shows commit history.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Commit hash&lt;/li&gt;
&lt;li&gt;Author&lt;/li&gt;
&lt;li&gt;Date&lt;/li&gt;
&lt;li&gt;Commit message&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This helps you understand project history.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FKR4n3KppXQQuNM1UItTePbCVd4oIdsInPiBoRMlneSQ%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93YWMt%2FY2RuLmF0bGFzc2lh%2Fbi5jb20vZGFtL2pj%2FcjpkMDEyMjNhNi1k%2FZjI1LTQ4YjMtODdm%2FZC0yYjkxNDBkOWFl%2FMmIvMDMlMjBTcXVh%2Fc2glMjBjb21taXRz%2FJTIwZm9yJTIwYSUy%2FMGNsZWFuJTIwaGlz%2FdG9yeS5zdmc_Y2Ru%2FVmVyc2lvbj0zMTQ1" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FKR4n3KppXQQuNM1UItTePbCVd4oIdsInPiBoRMlneSQ%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly93YWMt%2FY2RuLmF0bGFzc2lh%2Fbi5jb20vZGFtL2pj%2FcjpkMDEyMjNhNi1k%2FZjI1LTQ4YjMtODdm%2FZC0yYjkxNDBkOWFl%2FMmIvMDMlMjBTcXVh%2Fc2glMjBjb21taXRz%2FJTIwZm9yJTIwYSUy%2FMGNsZWFuJTIwaGlz%2FdG9yeS5zdmc_Y2Ru%2FVmVyc2lvbj0zMTQ1" alt="Commit history flow" width="860" height="576"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 git branch
&lt;/h3&gt;

&lt;p&gt;List all branches:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a new branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Switch branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(or modern way)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git switch feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔹 git merge
&lt;/h3&gt;

&lt;p&gt;Merge one branch into another.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git merge feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 Combines work from different branches.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔄 A Simple Git Workflow (From Scratch)
&lt;/h2&gt;

&lt;p&gt;Let's see a real beginner workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Create a project&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;my-project
&lt;span class="nb"&gt;cd &lt;/span&gt;my-project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Initialize Git&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Create a file&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Check status&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Stage the file&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 6: Commit changes&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add initial HTML file"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🎉 &lt;strong&gt;Congratulations!&lt;/strong&gt; You just created your first Git commit.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2Fbdj8jKBVZAjMxtmL_7jRZR_zBl-ORz1zZlqov3jiR2I%2Frs%3Afit%3A500%3A0%3A1%3A0%2Fg%3Ace%2FaHR0cHM6Ly9tZWRp%2FYS5nZXR0eWltYWdl%2Fcy5jb20vaWQvNjIx%2FODI3NDU4L3Bob3Rv%2FL2NlbGVicmF0aW5n%2FLW91ci1hY2hpZXZl%2FbWVudHMtdG9nZXRo%2FZXIuanBnP3M9NjEy%2FeDYxMiZ3PTAmaz0y%2FMCZjPTZnQUlYOXJu%2FVHEzb2s1MHU3TXZ6%2FcjhPeVY0X0s2NnNz%2FMmcyTUNoLVR2cDg9" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2Fbdj8jKBVZAjMxtmL_7jRZR_zBl-ORz1zZlqov3jiR2I%2Frs%3Afit%3A500%3A0%3A1%3A0%2Fg%3Ace%2FaHR0cHM6Ly9tZWRp%2FYS5nZXR0eWltYWdl%2Fcy5jb20vaWQvNjIx%2FODI3NDU4L3Bob3Rv%2FL2NlbGVicmF0aW5n%2FLW91ci1hY2hpZXZl%2FbWVudHMtdG9nZXRo%2FZXIuanBnP3M9NjEy%2FeDYxMiZ3PTAmaz0y%2FMCZjPTZnQUlYOXJu%2FVHEzb2s1MHU3TXZ6%2FcjhPeVY0X0s2NnNz%2FMmcyTUNoLVR2cDg9" alt="Success celebration" width="500" height="333"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  😄 Git Reality Check
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2F5HypYTi4jXrVLL2tWDwzdhrweKcyZiPJrEgif3MhbvI%2Frs%3Afit%3A500%3A0%3A1%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pLnBy%2Fb2dyYW1tZXJodW1v%2Fci5pby8yMDI1LzA0%2FLzY3ODljY2JhYzA4%2FMGE2OGRkMWVlZTlj%2FYWU3Mjc2M2FlNTM4%2FYmI4YWVkOTVjYzEx%2FYzJlY2EzZmViYWZj%2FZGExNzQucG5n" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2F5HypYTi4jXrVLL2tWDwzdhrweKcyZiPJrEgif3MhbvI%2Frs%3Afit%3A500%3A0%3A1%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pLnBy%2Fb2dyYW1tZXJodW1v%2Fci5pby8yMDI1LzA0%2FLzY3ODljY2JhYzA4%2FMGE2OGRkMWVlZTlj%2FYWU3Mjc2M2FlNTM4%2FYmI4YWVkOTVjYzEx%2FYzJlY2EzZmViYWZj%2FZGExNzQucG5n" alt="Git commit meme" width="500" height="358"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 Tips for Beginners
&lt;/h2&gt;

&lt;p&gt;✅ Run &lt;code&gt;git status&lt;/code&gt; often&lt;/p&gt;

&lt;p&gt;✅ Commit small, meaningful changes&lt;/p&gt;

&lt;p&gt;✅ Write clear commit messages&lt;/p&gt;

&lt;p&gt;✅ Don't fear breaking things — Git has your back&lt;/p&gt;

&lt;p&gt;✅ Practice with small projects&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1522202176988-66273c2fd55f%3Fw%3D800%26h%3D400%26fit%3Dcrop" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1522202176988-66273c2fd55f%3Fw%3D800%26h%3D400%26fit%3Dcrop" alt="Learning journey" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Conclusion
&lt;/h2&gt;

&lt;p&gt;Git might seem intimidating at first, but once you understand the basics, it becomes second nature.&lt;/p&gt;

&lt;p&gt;Start with these commands, practice regularly, and soon you'll be managing complex projects with confidence!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's your biggest Git challenge?&lt;/strong&gt; Drop a comment below! 👇&lt;/p&gt;




&lt;p&gt;=&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why Version Control Exists: The Pendrive Problem Every Developer Faced</title>
      <dc:creator>Harsh</dc:creator>
      <pubDate>Tue, 30 Dec 2025 18:29:49 +0000</pubDate>
      <link>https://forem.com/dark-lord-harsh/why-version-control-exists-the-pendrive-problem-every-developer-faced-1h0d</link>
      <guid>https://forem.com/dark-lord-harsh/why-version-control-exists-the-pendrive-problem-every-developer-faced-1h0d</guid>
      <description>&lt;h2&gt;
  
  
  Why Version Control Exists: From Pendrives to Git
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FlW1dXwcUl1y5mWmPm5BULMDXuoPJ88Qr24FD5_lSm18%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pLnJl%2FZGQuaXQvMDViNnUx%2FOXBzZW96LnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimgs.search.brave.com%2FlW1dXwcUl1y5mWmPm5BULMDXuoPJ88Qr24FD5_lSm18%2Frs%3Afit%3A860%3A0%3A0%3A0%2Fg%3Ace%2FaHR0cHM6Ly9pLnJl%2FZGQuaXQvMDViNnUx%2FOXBzZW96LnBuZw" alt="Version Control Hero" width="860" height="807"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're new to programming, you've probably heard developers say things like "Just push it to GitHub" or "Check the commit history." At first, it might feel unnecessary or confusing.&lt;/p&gt;

&lt;p&gt;So let's answer a simple question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does version control exist at all?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To understand that, we need to go back to how developers worked before tools like Git existed and the answer starts with pendrives, emails, and folders named &lt;code&gt;final_final&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Why Version Control Exists
&lt;/h3&gt;

&lt;p&gt;Version control is a system that keeps track of changes in your code over time.&lt;/p&gt;

&lt;p&gt;It helps developers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save their work safely&lt;/li&gt;
&lt;li&gt;Work together without breaking things&lt;/li&gt;
&lt;li&gt;Go back to older versions when something goes wrong&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But version control wasn't created because developers wanted fancy tools. It was created because &lt;strong&gt;the old ways of sharing code were painful and risky&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  The Pendrive Analogy in Software Development
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrive.google.com%2Fuc%3Fexport%3Dview%26id%3D1veUpdt95bWniDkAK8_Bl_dLR_YinlSdb" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdrive.google.com%2Fuc%3Fexport%3Dview%26id%3D1veUpdt95bWniDkAK8_Bl_dLR_YinlSdb" alt="USB Pendrive" width="760" height="760"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before version control systems, many developers followed a workflow like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write code on your computer&lt;/li&gt;
&lt;li&gt;Copy the project to a pendrive&lt;/li&gt;
&lt;li&gt;Give it to a teammate or email it&lt;/li&gt;
&lt;li&gt;Hope nothing breaks&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Soon, the project folder looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;📁 project
📁 project_final
📁 project_final_v2
📁 project_latest
📁 project_latest_final
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No one knew:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which version was correct&lt;/li&gt;
&lt;li&gt;Which changes were new&lt;/li&gt;
&lt;li&gt;What had been overwritten&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This method worked only when &lt;strong&gt;one person&lt;/strong&gt; was working. The moment a team got involved, things started falling apart.&lt;/p&gt;




&lt;h3&gt;
  
  
  Problems Developers Faced Before Version Control Systems
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Multiple Developers Overwriting Each Other's Code
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1516321497487-e288fb19713f%3Fw%3D800%26h%3D400%26fit%3Dcrop" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1516321497487-e288fb19713f%3Fw%3D800%26h%3D400%26fit%3Dcrop" alt="Conflict" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Imagine two developers working on the same file.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Developer A&lt;/strong&gt; edits the file and saves it&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developer B&lt;/strong&gt; edits the same file and saves it later&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Whoever saves last wins.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The other person's work is completely lost.&lt;/p&gt;

&lt;p&gt;This was a nightmare for collaboration.&lt;/p&gt;


&lt;h4&gt;
  
  
  2. File Versions Getting Lost Over Time
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1584438784894-089d6a62b8fa%3Fw%3D800%26h%3D400%26fit%3Dcrop" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1584438784894-089d6a62b8fa%3Fw%3D800%26h%3D400%26fit%3Dcrop" alt="Messy Files" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When something broke, developers had no easy way to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go back to a working version&lt;/li&gt;
&lt;li&gt;See what changed&lt;/li&gt;
&lt;li&gt;Fix the issue quickly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead, they relied on file names and memory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Day 1 → project
Day 3 → project_final
Day 5 → project_final_v2
Day 7 → project_latest
❓ Which one actually works?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There was no real history, just guesses.&lt;/p&gt;




&lt;h4&gt;
  
  
  3. No Record of Who Changed What (or Why)
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1484480974693-6ca0a78fb36b%3Fw%3D800%26h%3D400%26fit%3Dcrop" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1484480974693-6ca0a78fb36b%3Fw%3D800%26h%3D400%26fit%3Dcrop" alt="Question Mark" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When bugs appeared, developers asked questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Who changed this file?&lt;/li&gt;
&lt;li&gt;Why was this logic added?&lt;/li&gt;
&lt;li&gt;When did this break?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And most of the time &lt;strong&gt;"there were no answers"&lt;/strong&gt;.&lt;/p&gt;




&lt;h4&gt;
  
  
  4. Fear of Breaking the Project
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1555949963-ff9fe0c870eb%3Fw%3D800%26h%3D400%26fit%3Dcrop" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1555949963-ff9fe0c870eb%3Fw%3D800%26h%3D400%26fit%3Dcrop" alt="Broken Code" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Because there was no safety net:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Developers avoided experimenting&lt;/li&gt;
&lt;li&gt;New ideas felt risky&lt;/li&gt;
&lt;li&gt;One mistake could ruin everything&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This slowed down learning and innovation.&lt;/p&gt;




&lt;h3&gt;
  
  
  Why the Pendrive Model Failed for Teams
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1522071820081-009f0129c71c%3Fw%3D800%26h%3D400%26fit%3Dcrop" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1522071820081-009f0129c71c%3Fw%3D800%26h%3D400%26fit%3Dcrop" alt="Team Collaboration" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now imagine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;5–10 developers&lt;/li&gt;
&lt;li&gt;Working from different places&lt;/li&gt;
&lt;li&gt;Changing the same code every day&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pendrives, emails, and "final" folders simply couldn't scale.&lt;/p&gt;

&lt;p&gt;Teams needed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;single source of truth&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;complete history&lt;/strong&gt; of changes&lt;/li&gt;
&lt;li&gt;A way to &lt;strong&gt;work together without conflict&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where version control changed everything.&lt;/p&gt;




&lt;h3&gt;
  
  
  How Version Control Solved These Problems
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1618401471353-b98afee0b2eb%3Fw%3D800%26h%3D400%26fit%3Dcrop" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1618401471353-b98afee0b2eb%3Fw%3D800%26h%3D400%26fit%3Dcrop" alt="Git Workflow" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Version control systems introduced a better way:&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Every change is saved as a version&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;You can see who made a change and why&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;You can go back in time if something breaks&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Multiple developers can work at the same time&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✅ &lt;strong&gt;Experimenting becomes safe&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of guessing, developers gained &lt;strong&gt;clarity and confidence&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Why Version Control Is Mandatory Today
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1531297484001-80022131f5a1%3Fw%3D800%26h%3D400%26fit%3Dcrop" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1531297484001-80022131f5a1%3Fw%3D800%26h%3D400%26fit%3Dcrop" alt="Modern Development" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Today, tools like &lt;strong&gt;Git&lt;/strong&gt; and &lt;strong&gt;GitHub&lt;/strong&gt; are basic skills for developers.&lt;/p&gt;

&lt;p&gt;Without version control:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Team collaboration would be chaotic&lt;/li&gt;
&lt;li&gt;Bugs would be harder to fix&lt;/li&gt;
&lt;li&gt;Modern software development wouldn't be possible&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Version control exists because humans forget, overwrite, and make mistakes and &lt;strong&gt;software needed a system that doesn't&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1552664730-d307ca884978%3Fw%3D800%26h%3D400%26fit%3Dcrop" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1552664730-d307ca884978%3Fw%3D800%26h%3D400%26fit%3Dcrop" alt="Success" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The pendrive problem wasn't really about storage. It was about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lost work&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Broken collaboration&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No history&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No trust in the process&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Version control solved all of that.&lt;/p&gt;

&lt;p&gt;So when you learn Git, remember: &lt;strong&gt;you're not just learning a tool&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
You're learning the solution to a problem every developer once struggled with.&lt;/p&gt;




&lt;h3&gt;
  
  
  Remember This?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;📁 project
📁 project_final
📁 project_final_v2
📁 project_latest
📁 project_latest_final
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Those days are over.&lt;/strong&gt; Welcome to version control. 🚀&lt;/p&gt;

</description>
      <category>git</category>
      <category>versioncontrol</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
