<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Armankumar's Blogs]]></title><description><![CDATA[Armankumar's Blogs]]></description><link>https://blog.armankumarpatel.in</link><generator>RSS for Node</generator><lastBuildDate>Sat, 16 May 2026 01:41:47 GMT</lastBuildDate><atom:link href="https://blog.armankumarpatel.in/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Getting Started with cURL]]></title><description><![CDATA[What is cURL
cURL is a command-line tool. It lets you to send request to server and receive data from server, such as fetching a webpage or interacting with API directly from terminal. 
Why programmers need cURL
Programmers can have direct and raw ac...]]></description><link>https://blog.armankumarpatel.in/getting-started-with-curl</link><guid isPermaLink="true">https://blog.armankumarpatel.in/getting-started-with-curl</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[curl]]></category><dc:creator><![CDATA[ARMAN PATEL]]></dc:creator><pubDate>Fri, 23 Jan 2026 00:35:16 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-what-is-curl">What is cURL</h2>
<p>cURL is a command-line tool. It lets you to send request to server and receive data from server, such as fetching a webpage or interacting with API directly from terminal. </p>
<h2 id="heading-why-programmers-need-curl">Why programmers need cURL</h2>
<p>Programmers can have direct and raw access with servers right from terminal with any GUI, revealing responses, status codes, headers, etc.</p>
<h2 id="heading-making-your-first-request-using-curl">Making your first request using cURL</h2>
<p>Open you terminal and typein <code>curl https://example.com</code></p>
<pre><code>~ $ curl https:<span class="hljs-comment">//example.com</span>
&lt;!doctype html&gt;&lt;html lang="en"&gt;&lt;head&gt;&lt;title&gt;Example Domain&lt;/title&gt;&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;&lt;style&gt;body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}&lt;/style&gt;&lt;body&gt;&lt;div&gt;&lt;h1&gt;Example Domain&lt;/h1&gt;&lt;p&gt;This domain is for use in documentation examples without needing permission. Avoid use in operations.&lt;p&gt;&lt;a href="https://iana.org/domains/example"&gt;Learn more&lt;/a&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;
</code></pre><p>cURL with <code>-i</code> flag <code>curl -i https://example.com</code> reveals full headers, incuding status code 200.</p>
<pre><code>~ $ curl -i https:<span class="hljs-comment">//example.com</span>
HTTP/<span class="hljs-number">2</span> <span class="hljs-number">200</span> 
<span class="hljs-attr">date</span>: Wed, <span class="hljs-number">21</span> Jan <span class="hljs-number">2026</span> <span class="hljs-number">01</span>:<span class="hljs-number">43</span>:<span class="hljs-number">56</span> GMT
content-type: text/html
cf-ray: <span class="hljs-number">9</span>c131f9f9a143d2e-BLR
last-modified: Tue, <span class="hljs-number">20</span> Jan <span class="hljs-number">2026</span> <span class="hljs-number">21</span>:<span class="hljs-number">08</span>:<span class="hljs-number">27</span> GMT
<span class="hljs-attr">allow</span>: GET, HEAD
accept-ranges: bytes
<span class="hljs-attr">age</span>: <span class="hljs-number">12864</span>
cf-cache-status: HIT
<span class="hljs-attr">server</span>: cloudflare

&lt;!doctype html&gt;&lt;html lang="en"&gt;&lt;head&gt;&lt;title&gt;Example Domain&lt;/title&gt;&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;&lt;style&gt;body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}&lt;/style&gt;&lt;body&gt;&lt;div&gt;&lt;h1&gt;Example Domain&lt;/h1&gt;&lt;p&gt;This domain is for use in documentation examples without needing permission. Avoid use in operations.&lt;p&gt;&lt;a href="https://iana.org/domains/example"&gt;Learn more&lt;/a&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;
</code></pre><p>Here, we get complete headers followed by a html webpage, mimicking browser.</p>
<h2 id="heading-understanding-request-and-response">Understanding Request and Response</h2>
<p>Simple Request response cycle :</p>
<ul>
<li>A Client (Browser, cURL or app) sends request (with request headers and body) to server.</li>
<li>Request travels to server that hosts webpage or API. </li>
<li>Server processes request and returns a response to Client with Status Code (Such as 200 for OK, 400, 500, etc), response headers (extra info) and actual response body (such as html, json or image etc).</li>
<li>Client uses that response and do whatever it is supposed to do such as rendering html on browser or using response data in app or printing on terminal.</li>
</ul>
<p>For understanding complete request and response cycle, following command is useful : <code>curl -v https://example.com</code>. (v - verbose).</p>
<pre><code>~ $ curl -v https:<span class="hljs-comment">//example.com   </span>
* Host example.com:<span class="hljs-number">443</span> was resolved.
* IPv6: <span class="hljs-number">2606</span>:<span class="hljs-number">4700</span>:<span class="hljs-number">9</span>ae2:<span class="hljs-number">8</span>c7c:<span class="hljs-number">3342</span>:<span class="hljs-number">0</span>:ccc4:a209
* IPv4: <span class="hljs-number">104.18</span><span class="hljs-number">.26</span><span class="hljs-number">.120</span>, <span class="hljs-number">104.18</span><span class="hljs-number">.27</span><span class="hljs-number">.120</span>
*   Trying [<span class="hljs-number">2606</span>:<span class="hljs-number">4700</span>:<span class="hljs-number">9</span>ae2:<span class="hljs-number">8</span>c7c:<span class="hljs-number">3342</span>:<span class="hljs-number">0</span>:ccc4:a209]:<span class="hljs-number">443.</span>..
* Connected to example.com (<span class="hljs-number">2606</span>:<span class="hljs-number">4700</span>:<span class="hljs-number">9</span>ae2:<span class="hljs-number">8</span>c7c:<span class="hljs-number">3342</span>:<span class="hljs-number">0</span>:ccc4:a209) port <span class="hljs-number">443</span>
* ALPN: curl offers h2,http/<span class="hljs-number">1.1</span>
* (<span class="hljs-number">304</span>) (OUT), TLS handshake, Client hello (<span class="hljs-number">1</span>):
*  CAfile: <span class="hljs-regexp">/etc/</span>ssl/cert.pem
*  CApath: none
* (<span class="hljs-number">304</span>) (IN), TLS handshake, Server hello (<span class="hljs-number">2</span>):
* (<span class="hljs-number">304</span>) (IN), TLS handshake, Unknown (<span class="hljs-number">8</span>):
* (<span class="hljs-number">304</span>) (IN), TLS handshake, Certificate (<span class="hljs-number">11</span>):
* (<span class="hljs-number">304</span>) (IN), TLS handshake, CERT verify (<span class="hljs-number">15</span>):
* (<span class="hljs-number">304</span>) (IN), TLS handshake, Finished (<span class="hljs-number">20</span>):
* (<span class="hljs-number">304</span>) (OUT), TLS handshake, Finished (<span class="hljs-number">20</span>):
* SSL connection using TLSv1<span class="hljs-number">.3</span> / AEAD-CHACHA20-POLY1305-SHA256 / [blank] / UNDEF
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=example.com
*  start date: Dec <span class="hljs-number">16</span> <span class="hljs-number">19</span>:<span class="hljs-number">39</span>:<span class="hljs-number">32</span> <span class="hljs-number">2025</span> GMT
*  expire date: Mar <span class="hljs-number">16</span> <span class="hljs-number">18</span>:<span class="hljs-number">32</span>:<span class="hljs-number">44</span> <span class="hljs-number">2026</span> GMT
*  subjectAltName: host <span class="hljs-string">"example.com"</span> matched cert<span class="hljs-string">'s "example.com"
*  issuer: C=US; O=SSL Corporation; CN=Cloudflare TLS Issuing ECC CA 3
*  SSL certificate verify ok.
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://example.com/
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: example.com]
* [HTTP/2] [1] [:path: /]
* [HTTP/2] [1] [user-agent: curl/8.7.1]
* [HTTP/2] [1] [accept: */*]
&gt; GET / HTTP/2
&gt; Host: example.com
&gt; User-Agent: curl/8.7.1
&gt; Accept: */*
&gt; 
* Request completely sent off
&lt; HTTP/2 200 
&lt; date: Wed, 21 Jan 2026 01:49:00 GMT
&lt; content-type: text/html
&lt; cf-ray: 9c13270fd8c947c0-BOM
&lt; last-modified: Tue, 20 Jan 2026 21:08:27 GMT
&lt; allow: GET, HEAD
&lt; accept-ranges: bytes
&lt; age: 13169
&lt; cf-cache-status: HIT
&lt; server: cloudflare
&lt; 
&lt;!doctype html&gt;&lt;html lang="en"&gt;&lt;head&gt;&lt;title&gt;Example Domain&lt;/title&gt;&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;&lt;style&gt;body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}&lt;/style&gt;&lt;body&gt;&lt;div&gt;&lt;h1&gt;Example Domain&lt;/h1&gt;&lt;p&gt;This domain is for use in documentation examples without needing permission. Avoid use in operations.&lt;p&gt;&lt;a href="https://iana.org/domains/example"&gt;Learn more&lt;/a&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</span>
</code></pre><p>In this verbose view, we can see detailed request-response cycle including DNS resolution, TLS handshake, headers exchange and html body delivery. It shows every step that can not be viewed in browser.</p>
<h2 id="heading-using-curl-to-talk-to-apis">Using cURL to talk to APIs</h2>
<p>cURL can talk to APIs with http request, with various methods such as GET and POST.</p>
<p>We shall utilise public API for demonstration.</p>
<h3 id="heading-get-method-reading-or-fetching-data">GET method (reading or fetching data)</h3>
<pre><code>~ $ curl <span class="hljs-string">"https://api.freeapi.app/api/v1/public/randomjokes?limit=10&amp;query=science&amp;inc=categories%252Cid%252Ccontent&amp;page=1"</span>

{<span class="hljs-string">"statusCode"</span>:<span class="hljs-number">200</span>,<span class="hljs-string">"data"</span>:{<span class="hljs-string">"page"</span>:<span class="hljs-number">1</span>,<span class="hljs-string">"limit"</span>:<span class="hljs-number">10</span>,<span class="hljs-string">"totalPages"</span>:<span class="hljs-number">1</span>,<span class="hljs-string">"previousPage"</span>:<span class="hljs-literal">false</span>,<span class="hljs-string">"nextPage"</span>:<span class="hljs-literal">false</span>,<span class="hljs-string">"totalItems"</span>:<span class="hljs-number">4</span>,<span class="hljs-string">"currentPageItems"</span>:<span class="hljs-number">4</span>,<span class="hljs-string">"data"</span>:[{<span class="hljs-string">"categories"</span>:[<span class="hljs-string">"science"</span>],<span class="hljs-string">"id"</span>:<span class="hljs-number">140</span>,<span class="hljs-string">"content"</span>:<span class="hljs-string">"Science Fact: Roundhouse kicks are comprised primarily of an element called Chucktanium."</span>},{<span class="hljs-string">"categories"</span>:[],<span class="hljs-string">"id"</span>:<span class="hljs-number">456</span>,<span class="hljs-string">"content"</span>:<span class="hljs-string">"All science students maybe aware about the fact that picochuck is the unit of manliness in the International System of Units (SI). An average man measures about 0.00073 pc. Chuck Norris measures 39,372 petachucks."</span>},{<span class="hljs-string">"categories"</span>:[],<span class="hljs-string">"id"</span>:<span class="hljs-number">1073</span>,<span class="hljs-string">"content"</span>:<span class="hljs-string">"The 7 wonders of the world were actually Chuck Norris' science fair projects. And Chuck Norris is the 8th wonder of the world."</span>},{<span class="hljs-string">"categories"</span>:[],<span class="hljs-string">"id"</span>:<span class="hljs-number">1269</span>,<span class="hljs-string">"content"</span>:<span class="hljs-string">"Larry the Cable Guy was a nuclear science physics professor at MIT for only 3 seconds more after he called Chuck Norris' mother a \"slutty beatch of a crack whore\"."</span>}]},<span class="hljs-string">"message"</span>:<span class="hljs-string">"Random jokes fetched successfully"</span>,<span class="hljs-string">"success"</span>:<span class="hljs-literal">true</span>}%
</code></pre><h3 id="heading-post-method-for-sending-data-to-server">POST method (for sending data to server)</h3>
<pre><code>~ $ curl -d <span class="hljs-string">"hi"</span> https:<span class="hljs-comment">//httpbin.org/post</span>
{
  <span class="hljs-string">"args"</span>: {}, 
  <span class="hljs-string">"data"</span>: <span class="hljs-string">""</span>, 
  <span class="hljs-string">"files"</span>: {}, 
  <span class="hljs-string">"form"</span>: {
    <span class="hljs-string">"hi"</span>: <span class="hljs-string">""</span>
  }, 
  <span class="hljs-string">"headers"</span>: {
    <span class="hljs-string">"Accept"</span>: <span class="hljs-string">"*/*"</span>, 
    <span class="hljs-string">"Content-Length"</span>: <span class="hljs-string">"2"</span>, 
    <span class="hljs-string">"Content-Type"</span>: <span class="hljs-string">"application/x-www-form-urlencoded"</span>, 
    <span class="hljs-string">"Host"</span>: <span class="hljs-string">"httpbin.org"</span>, 
    <span class="hljs-string">"User-Agent"</span>: <span class="hljs-string">"curl/8.7.1"</span>, 
    <span class="hljs-string">"X-Amzn-Trace-Id"</span>: <span class="hljs-string">"Root=1-6972bf37-19e5eaee0489d67632d84838"</span>
  }, 
  <span class="hljs-string">"json"</span>: <span class="hljs-literal">null</span>, 
  <span class="hljs-string">"origin"</span>: <span class="hljs-string">"152.58.61.145"</span>, 
  <span class="hljs-string">"url"</span>: <span class="hljs-string">"https://httpbin.org/post"</span>
}
This send <span class="hljs-string">"hi"</span> <span class="hljs-keyword">as</span> form data to <span class="hljs-string">`https://httpbin.org/post`</span> and that form data is sent back by server <span class="hljs-keyword">as</span> json.
</code></pre><h2 id="heading-common-mistakes-beginners-make-with-curl">Common mistakes beginners make with cURL</h2>
<ul>
<li>Using URLs that contains '?' and '&amp;' without quotes</li>
<li>Forgetting HTTPS/443: curl http://example.com:443 fails. Fix: Use https:// prefix.</li>
<li>verbose debugging : add -v argument for verbose debugging if see TLS or DNS issues</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Understanding How DNS Resolution Works]]></title><description><![CDATA[What is DNS
Let's start with full name of DNS. Domain Name System. It is a system which translate human readable Domain Names to Machine readable IP address.
Why need Domain Names
We need Domain Name of server in order to connect with it, in human re...]]></description><link>https://blog.armankumarpatel.in/understanding-how-dns-resolution-works</link><guid isPermaLink="true">https://blog.armankumarpatel.in/understanding-how-dns-resolution-works</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[dns]]></category><category><![CDATA[dns-records]]></category><category><![CDATA[dns resolver]]></category><dc:creator><![CDATA[ARMAN PATEL]]></dc:creator><pubDate>Wed, 21 Jan 2026 01:09:02 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-what-is-dns">What is DNS</h2>
<p>Let's start with full name of DNS. Domain Name System. It is a system which translate human readable Domain Names to Machine readable IP address.</p>
<h3 id="heading-why-need-domain-names">Why need Domain Names</h3>
<p>We need Domain Name of server in order to connect with it, in human readable format. For example <code>google.com</code>. One can simply understand that we want to connect with Google. One can also typein IP address of Google directly, but it is not human friendly and Google might change IP, which is troublesome. ### Why Domain Name Resolution Domain Name Resolution is a system that bridges between human-friendly Domain Names and machine-friendly IP addresses. It maps Domain Names to IP addresses. DNS is just like phonebook of internet.</p>
<h3 id="heading-dns-is-centralised-why">DNS is centralised? Why ?</h3>
<p>DNS is a system that is not centralised. Because one centralised system can't resolve all IPs on the internet, and it can't be scalable. DNS is <strong>De-centalised</strong>. Domain Name Resolution is iterative process.</p>
<h2 id="heading-how-dns-works">How DNS works</h2>
<p>We will see how DNS works. 
For this we shall use a command-line utility named <code>dig</code> (<strong>Domain Information Grapper</strong>). It is used to query DNS servers and inspect DNS records. Open a terminal of your choice and typein <code>dig google.com</code>.
DNS is hierarchyal. Typically DNS resolution flows through three logical layers:</p>
<ul>
<li><p>Root name servers :</p>
<ul>
<li>Root servers do not know IP of queried Domain Name (google.com), but they give IP of TLD servers, such as <code>.com</code> TLD server. This starting of recursion.</li>
<li>There are 13 root servers. There are more than 1900 implementations of root servers.</li>
<li>One can query root servers by running <code>dig . NS</code> in terminal.</li>
</ul>
</li>
<li><p>TDL (Top Level Domain) name server : They are referred by root server.</p>
<ul>
<li>TLD servers maintain delegation of all TLD records r that particular TLD. Such as <code>.com</code> records are maintained by <code>.com</code> TLD servers. TLD server prrovide IP of Authoratative name server.</li>
<li><code>dig com NS</code> or <code>dig in NS</code> are the commands for querying TLD servers.</li>
</ul>
</li>
<li>Authoratative name server : <ul>
<li>Authoratative name server holds DNS records such as A/AAA, proving final IP address.</li>
<li><code>dig google.com NS</code> returns IP of Authoratative Name Server.
After all this recursion, requesting host gets resolved IP of desired server. Then TCP and TLS connection happens and then https request happens.
All this recursive process happens only if resolved IP is not cached in requesting host.</li>
</ul>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768912098487/ac29ce32-f59f-4393-a376-28fbbfec3f00.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-types-of-dns-records">Types of DNS Records</h2>
<p>After this complete recursive DNS resolution, when one gets IP of Authoratative Name server, that Authoratative Name server holds DNS records. These DNS records tell which server t connect to or which who receives email for this server.</p>
<ul>
<li>A record : <ul>
<li>A record simply maps domain or subdomain (example.com) to  IPv4 address (like 172.23.46.107).Meaning if someone visits <code>example.com</code>, then they should connect to <code>172.23.46.107</code>.</li>
<li>Domain or subdomain can have multiple A records. For Load balancing and Fail over server.</li>
</ul>
</li>
<li>AAAA Record : <ul>
<li>AAAA record is just like A record but for IPv6 addresses.</li>
<li>AAAA record maps domain or subdomain to IPv6 address (such as 2001:db8::1).</li>
<li>Domain or subdomain can have both A and AAAA record. Clients supported by IPv6 address shall prefer AAAA record, while others use A record.</li>
</ul>
</li>
<li>CNAME Record : <ul>
<li>CNAME records points to another Name, which hold A/AAAA record.</li>
<li>for example <code>blog.xyz.in</code> has CNAME record <code>hashnode.network</code>. This is just CNAME record. But actual IPv4 address is resolved on <code>hashnode.network</code> (which is holding A/AAAA record poining to IP of blog).</li>
<li>CNAMEs simplify hosting with SaaS, as one can point own domain or subdomain to them and they handles IPs behind it.</li>
</ul>
</li>
<li>MX Record :<ul>
<li>MX is for Mail Exchange.</li>
<li>MX record holds hostname (such as <code>mail.example.com</code>) to which mail is to be delivered.</li>
<li>MX record does not point to IP address, but points to hostname. That hostname must have its own A/AAAA records.</li>
</ul>
</li>
<li>TXT record : <ul>
<li>TXT record stores free form text data associated with domain, for machines rather than humans.</li>
<li>Common uses include SPF, DKIM, and DMARC email-authentication data, and ownership verification for services like Google Workspace or Microsoft 365.</li>
</ul>
</li>
<li>NS Record : <ul>
<li>NS record points which Name Servers to use for your DNS Hosting.</li>
<li>Usually your Domain Registry holds DNS records, but for reason you want another DNS hosting service, then you can add NS record (in your Domain Registry) pointing to Name Server of another DNS Hosting provider.</li>
</ul>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Git internals and Basic Commands]]></title><description><![CDATA[In this article we are going to take a look how git works internally. We shall learn some basic git commands on the go.
We shall start with empty project. In my case, have created a folder named "git-internals-learn-2", and opened that folder/project...]]></description><link>https://blog.armankumarpatel.in/git-internals-and-basic-commands</link><guid isPermaLink="true">https://blog.armankumarpatel.in/git-internals-and-basic-commands</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Git]]></category><dc:creator><![CDATA[ARMAN PATEL]]></dc:creator><pubDate>Sat, 17 Jan 2026 17:08:46 GMT</pubDate><content:encoded><![CDATA[<p>In this article we are going to take a look how git works internally. We shall learn some basic git commands on the go.</p>
<p>We shall start with empty project. In my case, have created a folder named "git-internals-learn-2", and opened that folder/project in VS Code. Keep the VS Code's integrated terminal open. There is no file or folder in the project now, one can check that by running following command in terminal.</p>
<pre><code>ls -a

<span class="hljs-attr">Output</span> : 
git-internals-learn<span class="hljs-number">-2</span> $ ls -a
.  ..
</code></pre><p>Now let's initialise git. Meaning that as and when we create files and folders, it will be tracked by git in terms of version control &amp; colloboration. In order to initialise git, run following command :</p>
<pre><code>git init

<span class="hljs-attr">Output</span> :
git-internals-learn<span class="hljs-number">-2</span> $ git init
Initialized empty Git repository <span class="hljs-keyword">in</span> xyz/git-internals-learn<span class="hljs-number">-2</span>/.git/
</code></pre><p>This command has created a hidden folder named <code>.git</code> inside the project. One can check with following command :</p>
<pre><code>ls -a

<span class="hljs-attr">Output</span> : 
git-internals-learn<span class="hljs-number">-2</span> $ ls -a
.    ..   .git
</code></pre><p>And initial folder structure inside <code>.git</code> folder is as under (can be checked via VS Code Explorer) :</p>
<pre><code>.git/
├── HEAD
├── config
├── description
├── hooks/
│   ├── applypatch-msg.sample
│   ├── commit-msg.sample
│   ├── fsmonitor-watchman.sample
│   ├── post-update.sample
│   ├── pre-applypatch.sample
│   ├── pre-commit.sample
│   ├── pre-merge-commit.sample
│   ├── pre-push.sample
│   ├── pre-rebase.sample
│   ├── pre-receive.sample
│   ├── prepare-commit-msg.sample
│   └── update.sample
├── info/
│   └── exclude
├── objects/
│   ├── info/
│   └── pack/
└── refs/
    ├── heads/
    └── tags/
</code></pre><p>We have not learned anything yet but have a look at following Key Points, we shall revisit them as and when we learn and things will become clearer :</p>
<ul>
<li><p>HEAD : In this file, it says "ref: refs/heads/main" which points to "refs/heads/main" . But right now "ref/head" is empty, there will be "main" when we shall add something in git.</p>
</li>
<li><p>config file contains some standard configuration.</p>
</li>
<li><p>description file's content says "Unnamed repository; edit this file 'description' to name the repository."</p>
</li>
<li><p>Sample hooks only: hooks/ contains only *.sample files; they are templates that become active if renamed (e.g., pre-commit). We shall keep any eye on them.</p>
</li>
<li><p>info/exclude file is local ignore file, in which we can add things which we don't want git to track and ignore (mostly files and folders which can be regenerated easily and does not make sense to track them).</p>
</li>
<li><p>No objects yet: objects/ is empty except for the info/ and pack/ directories because there are no commits or blobs until the first git add + git commit. We shall learn about these terms.</p>
</li>
<li><p>refs/heads and refs/tags exist but are empty until the first commit creates a branch reference (like refs/heads/main).</p>
</li>
</ul>
<p>We have taken a look at directory structure and what files are there when we initialise a project. We have introduced terms like "add", "commit", "head", "main", "hooks", "objects", "blob", etc. These terms are not of same category and not of any order, but we have introduced while exploring <code>.git</code> folder.</p>
<p>Now lets create a file is our project folder. Either with VS Code Explorer or with following command in terminal :</p>
<pre><code>cat &gt; file1.txt &lt;&lt; <span class="hljs-string">'EOF'</span>
This is first file1 creation. One can say it a <span class="hljs-string">"Title Line"</span>.
EOF
</code></pre><p>file1.txt is created with content we provided. Notice for any change in any file in <code>.git</code> folder. Right now even after file1.txt creation, there is not change in <code>.git</code> folder. This is because we have not yet asked git to track anything. By "tracking", I mean track file/folder for version controlling and colloboration, which are the things we want to use git for in the first place (we had discussed in a dedecated previous article). But how to ask git to track files. But first, let's check the status of the project by running following command :</p>
<pre><code>git status

<span class="hljs-attr">Output</span> : 
git-internals-learn<span class="hljs-number">-2</span> $ git status
On branch main

No commits yet

Untracked files:
  (use <span class="hljs-string">"git add &lt;file&gt;..."</span> to include <span class="hljs-keyword">in</span> what will be committed)
        file1.txt
</code></pre><p>The output shows that our project is on <code>main</code> branch, there are no commits (we shall learn about it later) yet, and there is one file <code>file1.txt</code> is untracked, as we have discussed.</p>
<p>This is where our first git command comes into action. The command is <code>git init &lt;filename&gt;</code>. This shall tell git to track that particular file from now onwards, this is called moving the file into <strong>Staging Area</strong>. Let's put our <code>file1.txt</code> into a staging area and look for any changes in <code>.git</code> folder. Run following command :</p>
<pre><code>git add file1.txt
</code></pre><p>The <code>file1.txt</code> is added into Staging Area. Check <code>git status</code> :</p>
<pre><code>git status
<span class="hljs-attr">Output</span> : 
git-internals-learn<span class="hljs-number">-2</span> $ git status
On branch main

No commits yet

Changes to be committed:
  (use <span class="hljs-string">"git rm --cached &lt;file&gt;..."</span> to unstage)
        <span class="hljs-keyword">new</span> file:   file1.txt
</code></pre><p>And there are two changes is <code>.git</code> folder :</p>
<ul>
<li><p><code>.git/index</code> file is created.</p>
</li>
<li><p><code>git/objects/60/d0624e907d248246dd0a1824fd4dc9d3971629</code> is created.</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Why Version Control Exists: The Pendrive Problem]]></title><description><![CDATA[Today I am going to write down about Version Control System. Why it exists, what is its importance and what problem it does solve.
Tracking Changes
We are going to discuss in term of software developement. Let’s say, we are writing a software of any ...]]></description><link>https://blog.armankumarpatel.in/why-version-control-exists-the-pendrive-problem</link><guid isPermaLink="true">https://blog.armankumarpatel.in/why-version-control-exists-the-pendrive-problem</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Git]]></category><dc:creator><![CDATA[ARMAN PATEL]]></dc:creator><pubDate>Tue, 13 Jan 2026 00:46:26 GMT</pubDate><content:encoded><![CDATA[<p>Today I am going to write down about Version Control System. Why it exists, what is its importance and what problem it does solve.</p>
<h2 id="heading-tracking-changes">Tracking Changes</h2>
<p>We are going to discuss in term of software developement. Let’s say, we are writing a software of any kind. Typical folder with bunch of subfolders and files structured according to the project.</p>
<p>Any software is not build in one go. It is developed over many iterations over time. And there may be many contributors in the development of software.</p>
<p>Initially when the software is of not that big scale, it is ok (and easier) to remember changes made into code (or any format/file), and it is not even important to track changes (when it is not of big scale). But as and when complexities arise when project scales, it is really important to track changes.</p>
<h2 id="heading-tracking-who-contributed">Tracking Who Contributed</h2>
<p>If there is no version control / collaborator System, when one (Let's say Person A) had to share project with colleage or friend (Let's say person B), he/she would have to copy entire project folder and send it over some media sharing device such as pendrive (or zip folder and send it over internet).</p>
<p>Then his/her friend/colleague would make changes in the project and send the entire project back over by any means (same pendrive). But now person A does not know what person B changed in the project, unless told personally/telephonically/emailly, but it is cumbersome everytime.</p>
<p>Moreover, untill project is got back from person B to person A, person A would not be able to do any changes in his copy of project because he will be out of sync.</p>
<h2 id="heading-versioning-before-git">Versioning before GIT</h2>
<p>Imagine our scenario, after so many back and fourth, what would be space look like where project folder is saved. It would have proct folder name like project, project_version_1, project_version_2, project_final, project_final_version_2, etc.</p>
<p>This is unreadable, clumsy and hard to remember. And most important, it is not scalable.</p>
<p>This scenario we discussed only involved two persons. Image more people are in the development. What will be the problems.</p>
<p>Same code (or anything) edited by more than one persons would be hard to hande. There is no collaborative history is maintained. Losing code would be common problem.</p>
<h2 id="heading-solution">Solution</h2>
<p>In order to overcome all the problems and challenges, GIT was invented by legendary Linus Torvalds, the creator of Linux. This made software development more scalable, collaborative and tracking changes / contribution easier.</p>
<p>Plus, we have not discussed but branching of software development journey is also well handled by GIT. And merging also.</p>
<h2 id="heading-future-article">Future Article</h2>
<p>We shall look into how internally GIT works and some basic commands and workflows of GIT.</p>
]]></content:encoded></item></channel></rss>