<?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[Himal]]></title><description><![CDATA[Himal]]></description><link>https://subedihimal.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 25 Jun 2026 20:31:23 GMT</lastBuildDate><atom:link href="https://subedihimal.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How a Browser Works- A Beginner Friendly Guide to Browser Internals]]></title><description><![CDATA[Browser is an application that runs on top of your operating system used to surf the web. It is very complex as it is able to utilize your computer system hardware to run complex web application and even games. It not only displays the webpages but a...]]></description><link>https://subedihimal.hashnode.dev/how-a-browser-works-a-beginner-friendly-guide-to-browser-internals</link><guid isPermaLink="true">https://subedihimal.hashnode.dev/how-a-browser-works-a-beginner-friendly-guide-to-browser-internals</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[How a Browser Works: A Beginner-Friendly Guide to Browser Internals]]></category><category><![CDATA[how browser work]]></category><category><![CDATA[web browser]]></category><category><![CDATA[Browsers]]></category><dc:creator><![CDATA[Himal Subedi]]></dc:creator><pubDate>Fri, 30 Jan 2026 08:21:37 GMT</pubDate><content:encoded><![CDATA[<p>Browser is an application that runs on top of your operating system used to surf the web. It is very complex as it is able to utilize your computer system hardware to run complex web application and even games. It not only displays the webpages but also handle use interactions, run various scripts, manage security and communicate with web servers. They act as an interface between the user and the internet.</p>
<p><strong>Main Parts of a browser</strong></p>
<ul>
<li><p>User Interface (UI) : With the use of ui you interact with the browser. This includes the address bar, back/ forward buttons, tabs .. etc</p>
</li>
<li><p>Browser Engine: It is the coordinator between the UI and the render engine. It ensures whatever is rendered by the render engine is displayed by the ui</p>
</li>
<li><p>Render Engine: Converts HTML, CSS and JavaScript into visual and interactive elements in the screen</p>
</li>
<li><p>Networking: Fetches resources either using HTTP or HTTPS</p>
</li>
<li><p>JavaScript Engine: Executes JavaScript logics in the page</p>
</li>
<li><p>Data Storage: Stores cache, keys, token and passwords</p>
</li>
</ul>
<p><strong>Browser Engine vs Render Engine</strong> The browser engine acts as a bridge between the UI and the Render Engine whereas the Render Engine is responsive for doing all the calculations on how the website should look, what should happen after you press a button, calculations for the animations and visuals you see in the web-apps. Now a days render engine takes advantage of gpu acceleration to make animation and rendering a lot more efficient and fast.</p>
<p><strong>Real world example of how a browser works</strong></p>
<ul>
<li><p>You write <a target="_blank" href="http://facebook.com">facebook.com</a> on the address bar and press enter</p>
</li>
<li><p>Browser resolves the domain using DNS</p>
</li>
<li><p>Fetches the resources from the ip address that the authoritative DNS provider gave</p>
</li>
<li><p>Parses the HTML into the DOM (Document Object Model)</p>
</li>
<li><p>Parses CSS into the CSSOM (CSS Object Model)</p>
</li>
<li><p>Combines DOM and CSSOM into the <strong>render tree</strong></p>
</li>
<li><p>Preform layout calculations and displays the webpage</p>
</li>
<li><p>Executes JavaScript Using the javascript Engine to handle user interactions</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[How DNS Resolution Works]]></title><description><![CDATA[Domain Name System (DNS) is like a phonebook for the internet. Every website has an IP address and we use DNS to find the ip address of those website with human readable names like google.com. This process is called a domain name resolution and it re...]]></description><link>https://subedihimal.hashnode.dev/how-dns-resolution-works</link><guid isPermaLink="true">https://subedihimal.hashnode.dev/how-dns-resolution-works</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[dns]]></category><category><![CDATA[how dns resolution works]]></category><category><![CDATA[dig command]]></category><dc:creator><![CDATA[Himal Subedi]]></dc:creator><pubDate>Fri, 30 Jan 2026 08:18:38 GMT</pubDate><content:encoded><![CDATA[<p>Domain Name System (DNS) is like a phonebook for the internet. Every website has an IP address and we use DNS to find the ip address of those website with human readable names like <a target="_blank" href="http://google.com"><code>google.com</code></a>. This process is called a domain name resolution and it removes the necessity of users to remember the actual ip of the webpage.</p>
<p><code>dig</code> Command : dig is a command line tool used to query dns server and see how the dns is resolved.</p>
<p><code>dig . NS</code> -&gt; shows all the available root servers dig com NS -&gt; shows all Top Level Domain Servers from .com dig <a target="_blank" href="http://google.com">google.com</a> NS -&gt; shows the authoritative name server for <a target="_blank" href="http://google.com">google.com</a></p>
<p>When the <code>dig</code> command is used to resolve a domain like <a target="_blank" href="http://google.com">google.com</a>. It emulates the full DNS lookup. First dig . Ns queries the root name servers are responsible for the top-level domain (TLDs) such as .com . After that <code>dig com NS</code> asks the .com TLD servers to identify the authoritative name server for <a target="_blank" href="http://google.com"><code>google.com</code></a>. Then <code>dig</code> <a target="_blank" href="http://google.com"><code>google.com</code></a> <code>NS</code> gets the authoritative name server that actually stores the dns of <a target="_blank" href="http://google.com"><code>google.com</code></a>. Finally this authoritative name server provides the DNS records like A (ipv4 address) and AAAA (ipv6 address) of the website. Using dig allows you to trace the full DNS resolution path from root to the TLD to authoritative server and finally till the domains ip address.</p>
<p><strong>Example of using</strong> <code>dig</code> command</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769761070152/023084ba-01bc-4d30-b12f-1395bdcc5a88.png" alt /></p>
]]></content:encoded></item><item><title><![CDATA[Getting Started with cURL]]></title><description><![CDATA[CURL is a command line tools that allows you to send requests, download files and interact with APIs. It works any operating system like windows,mac and linux. It is similar to postman but doesn't have a GUI. Programmers use curl for the following pu...]]></description><link>https://subedihimal.hashnode.dev/getting-started-with-curl</link><guid isPermaLink="true">https://subedihimal.hashnode.dev/getting-started-with-curl</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[curl]]></category><category><![CDATA[Getting started with cURL]]></category><category><![CDATA[curl-command]]></category><category><![CDATA[cURL for beginner]]></category><dc:creator><![CDATA[Himal Subedi]]></dc:creator><pubDate>Fri, 30 Jan 2026 08:16:16 GMT</pubDate><content:encoded><![CDATA[<p>CURL is a command line tools that allows you to send requests, download files and interact with APIs. It works any operating system like windows,mac and linux. It is similar to postman but doesn't have a GUI. Programmers use curl for the following purposes:</p>
<ul>
<li><p>Testing Websites: Curl is used to check if the API is running or not. Either for a deployed website or hosted on the local computer</p>
</li>
<li><p>Debugging: curl can be used to see what exactly the server sends back as a response, giving insights to debugging efforts.</p>
</li>
</ul>
<p><strong>Making First request using curl</strong></p>
<p>You can try using curl by opening the terminal in mac/ linux or the command prompt in windows and running this command</p>
<p><code>curl</code> <a target="_blank" href="https://www.google.com"><code>https://www.google.com</code></a> The output may look very messy as it basically provides all the html,css and js for <a target="_blank" href="http://google.com">google.com</a> website</p>
<p><strong>You can also use the -I flag to only get the headers here is an example</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769760858721/1fc4770b-11c7-4832-b710-4665c7b3ebe6.png" alt /></p>
<p>Every-time you are using cURL you are sending a request to the server and then receiving a response. The request contains the URL, http method (GET, POST, PUT, PATCH, DELETE), headers and the data you want to send. And the server sends back a response. The response includes status codes like (200, 2001, 400, 4001 ... etc) each status code has it own specific meaning. In the above example the google server sent back a http 200 status code, meaning everything is working fine.</p>
<p>Using crul although seems easy, some beginners often miss a minute details and scratch there heads when they don't get the response that they were hoping for. Here are some things to keep in mind when using curl.</p>
<ul>
<li><p>Protocol: http / https</p>
</li>
<li><p>Method: Use correct method Get/ Post/ Put/ Patch/ Delete</p>
</li>
<li><p>Data Format: Ensure correct data format JSON/ XML</p>
</li>
<li><p>Authentication tokens / keys</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[DNS Record Types Explained]]></title><description><![CDATA[DNS stands for Domain Name System, it a distributed system made up of various servers working together to translate the domain name for example "abc.com" into its actual ip address. The ip address is the actual address where the website services can ...]]></description><link>https://subedihimal.hashnode.dev/dns-record-types-explained</link><guid isPermaLink="true">https://subedihimal.hashnode.dev/dns-record-types-explained</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[dns]]></category><category><![CDATA[DNS Record Types]]></category><category><![CDATA[dns-records]]></category><dc:creator><![CDATA[Himal Subedi]]></dc:creator><pubDate>Fri, 30 Jan 2026 08:13:04 GMT</pubDate><content:encoded><![CDATA[<p>DNS stands for Domain Name System, it a distributed system made up of various servers working together to translate the domain name for example "<a target="_blank" href="http://abc.com">abc.com</a>" into its actual ip address. The ip address is the actual address where the website services can be accessed from. DNS records are needed to ensure that these webpages can be accessed via their domain name and we don't need to remember or use the actual ip while trying to access these webpages or services.</p>
<p><strong>NS Record</strong> NS or Name Server Record is a type of dns record which tells you which dns providers server are authoritative for the dns you are searching for. These dns provider servers store <strong>all DNS records</strong> for that domain, such as A, AAAA, CNAME, MX, and TXT records. NS record generally point towards big DNS hosting providers such as godaddy,namecheap,cloudfare.</p>
<p>Some important DNS Record Types Explained in short:</p>
<ul>
<li><p><strong>A Record</strong> -&gt; Refers to the domain address in ipv4 format</p>
</li>
<li><p><strong>AA Record</strong> -&gt; Refers to the domain address in ipv6 format</p>
</li>
<li><p>CName -&gt; Maps one domain to another domain Eg: (<a target="_blank" href="http://www.google.com">www.google.com</a> is a cname for <a target="_blank" href="http://google.com">google.com</a>)</p>
</li>
<li><p>MX Server -&gt; Specifies which domain server receives email for the domain</p>
</li>
<li><p>TXT Record -&gt; TXT record is a record that stores text information associated with the domain. Commonly used for domain ownership verification.</p>
</li>
</ul>
<p><strong>Example Scenario How they all work together</strong> When you visit <a target="_blank" href="http://www.abc.com"><code>www.abc.com</code></a>, the dns system first looks at the www in the <strong>CNAME</strong> pointing towards <a target="_blank" href="http://abc.com"><strong>abc.com</strong></a>. The DNS then looks up <a target="_blank" href="http://abc.com"><code>abc.com</code></a> and finds the <strong>A Record</strong> and the <strong>AAAA Record</strong> of the server hosting the website. This gives the actual address of where the servers of <a target="_blank" href="http://abc.com">abc.com</a> are. Now your browser is able to access the website. If you send email to @<a target="_blank" href="http://abc.com">abc.com</a> then all the traffics are routed to the <strong>MX Record</strong> of that particular url and the <strong>TXT Record</strong> is used to verify the ownership of the email through SPF?DKIM checks. All these records are stored in the DNS provider's authoritative servers, which are pointed towards by the <strong>NS Record</strong> ensuring everything works as intended and the end-user can browse the internet without having to deal with all the complex internal working mechanism.</p>
]]></content:encoded></item><item><title><![CDATA[TCP Working 3-Way Handshake & Reliable Communication]]></title><description><![CDATA[Transmission Control Protocol (TCP) is a reliable protocol which governs the transfer of data over the internet. It is needed as without a concrete set of rules different types of devices running different software between them wont be able to intera...]]></description><link>https://subedihimal.hashnode.dev/tcp-working-3-way-handshake-and-reliable-communication</link><guid isPermaLink="true">https://subedihimal.hashnode.dev/tcp-working-3-way-handshake-and-reliable-communication</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[TCP Working: 3-Way Handshake & Reliable Communication]]></category><category><![CDATA[TCP]]></category><category><![CDATA[3-way handshake]]></category><category><![CDATA[#3-way handshaking]]></category><category><![CDATA[4 Way Handshake]]></category><dc:creator><![CDATA[Himal Subedi]]></dc:creator><pubDate>Wed, 28 Jan 2026 13:47:59 GMT</pubDate><content:encoded><![CDATA[<p>Transmission Control Protocol (TCP) is a reliable protocol which governs the transfer of data over the internet. It is needed as without a concrete set of rules different types of devices running different software between them wont be able to interact with each other. And the whole internet as we know now wont be possible.</p>
<p><strong>Problems TCP solves</strong></p>
<ul>
<li><p>Lack of standardization</p>
</li>
<li><p>Un-reliable data transfer over the internet</p>
</li>
<li><p>Error Detection</p>
</li>
<li><p>Ordered delivery of package</p>
</li>
</ul>
<p><strong>Three way handshake</strong> is a mechanism that TCP uses to ensure that a reliable connection between the server and the client.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769608009864/4124b4c8-65a9-434b-bf58-8e76a2fdf5c5.jpeg" alt /></p>
<p>In the beginning the client sends a Synchronization Request, the server sends back New Synchronization Request plus an Acknowledgement and finally the client sends an Acknowledgement. The 3-way handshake happens at the start of every connection and a 4-way handshake is used to terminate a connection.</p>
<p>The main selling point of TCP is its reliableness and correctness. TCP ensure this by the following ways:</p>
<ul>
<li><p>Three way handshake</p>
</li>
<li><p>Each data segment sent by the sender needs to be replied with an Acknowledgement</p>
</li>
<li><p>Each data packed it sequenced with numbers</p>
</li>
<li><p>Checksums are used to check for corruptions</p>
</li>
</ul>
<p><strong>Closing of TCP Connection</strong></p>
<p>TCP connection is closed using a 4 way handshake</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769608012874/1c8cda75-4985-4ae5-bc1b-05d73e5f6a97.png" alt /></p>
<p>Starting with a Fin request from the side that want to close the connection lets say its the client. After receiving the Fin request the server sends an ACK along with a FIN Request of its own. The client sends back an Ack at the end leading to the termination of the connection.</p>
]]></content:encoded></item><item><title><![CDATA[TCP vs UDP - When to Use What, and How TCP Relates to HTTP]]></title><description><![CDATA[TCP
Transmission Control Protocol is basically rules that govern the transfer of packages or data over the internet. It is a reliable protocol which ensures that the data packet is transferred to the required destination and even if the data packet f...]]></description><link>https://subedihimal.hashnode.dev/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</link><guid isPermaLink="true">https://subedihimal.hashnode.dev/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[TCP]]></category><category><![CDATA[#TCP #UDP #Networking #TechExplained #Protocols #DataTransfer #WebDevelopment #InternetTechnology #Coding #Programming #TechInsights #NetworkProtocols #TechTips #ComputerScience #TechForBeginners]]></category><category><![CDATA[UDP]]></category><category><![CDATA[http]]></category><dc:creator><![CDATA[Himal Subedi]]></dc:creator><pubDate>Wed, 28 Jan 2026 13:40:07 GMT</pubDate><content:encoded><![CDATA[<h3 id="heading-tcp">TCP</h3>
<p>Transmission Control Protocol is basically rules that govern the transfer of packages or data over the internet. It is a reliable protocol which ensures that the data packet is transferred to the required destination and even if the data packet failed to transfer, the sender gets to know as it wont receive a acknowledgement. Here data is converted into smaller chunks called segments</p>
<h3 id="heading-udp">UDP</h3>
<p>User Datagram Protocol is another type of rules that govern the transfer of packages or data over the internet. It is unreliable compared to TCP but is a lot more lightweight and fast. Data is converted int small chunks called datagrams</p>
<p><strong>Key differences between tcp and udp</strong></p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>TCP</td><td>UDP</td></tr>
</thead>
<tbody>
<tr>
<td>It is a Reliable Protocol</td><td>It is a unreliable Protocol</td></tr>
<tr>
<td>Uses 3 way handshake</td><td>Doesn't use any handshake mechanism</td></tr>
<tr>
<td>Slow compared to udp</td><td>Fast compared to tcp</td></tr>
<tr>
<td>Data is converted into small chunks called segments</td><td>Data is converted into small chunks called datagram</td></tr>
<tr>
<td>Resends lost packets</td><td>No resending</td></tr>
</tbody>
</table>
</div><p>You should use tcp where the data is very important and the sequence of the data is also very important. <strong>Some Use Case of TCP are:</strong></p>
<ul>
<li><p>Messages/ Emails</p>
</li>
<li><p>Banking Transactions</p>
</li>
<li><p>Sending Images</p>
</li>
<li><p>Software/ Application download</p>
<p>  In other hand you should use UDP when the sequence of data or the data packet it self is less important then fast delivery. <strong>Some use case of UDP are:</strong></p>
</li>
<li><p>Video/Audio Call</p>
</li>
<li><p>Live Board-casting</p>
</li>
<li><p>Gaming</p>
</li>
</ul>
<h3 id="heading-http">HTTP</h3>
<p>HTTP stands for Hyper-Text Transfer Protocol. It is a set of rules that govern the transfer of data between the server and the client that may include html, css, images, videos, javascript, browser resources which are used by your web applications to display an interactive webpage. Http uses TCP in the transport layer, making it a reliable protocol. Http works on top of Tcp and tcp ensures that the packages of http is delivered.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding Network Devices]]></title><description><![CDATA[What solution comes to mind when the internet stops working. Probably to restart the router, right ?. If you were born before the early 2000, you will probably remember there being two routers one with an antenna and one without one. The one without ...]]></description><link>https://subedihimal.hashnode.dev/understanding-network-devices</link><guid isPermaLink="true">https://subedihimal.hashnode.dev/understanding-network-devices</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[network]]></category><category><![CDATA[networking]]></category><category><![CDATA[router]]></category><category><![CDATA[firewall]]></category><category><![CDATA[Firewalls]]></category><category><![CDATA[Load Balancer]]></category><dc:creator><![CDATA[Himal Subedi]]></dc:creator><pubDate>Wed, 28 Jan 2026 13:33:45 GMT</pubDate><content:encoded><![CDATA[<p>What solution comes to mind when the internet stops working. Probably to restart the router, right ?. If you were born before the early 2000, you will probably remember there being two routers one with an antenna and one without one. The one without the antenna is called a modem and the one with the antenna is called a router. Nowadays you have a router that has modem built in it, or if you use optical fiber for the internet, modem is not required at all, so the newer generation of people aren't familiar with the word modem.</p>
<p>So the question may arise in your mind what is a modem and a router ? A modem is basically a device that converts digital signals that is understood by our computers into analog signal that is more efficient for transmission and vice versa. You needed this in the past as the router didn't understand analog signal and the coaxial cable used for transmitting the data back in the day only supported analog transmission. So modem was basically a translating device for the router and the cable infrastructure.</p>
<p><strong>Routers</strong></p>
<p>The miracle box that makes the internet work in your device. It works like a postman but for digital packages. It reads the address on the package (IP address on the header of the data package) and then determines which device is the ultimate destination for the package. And sends the package to the device either wirelessly or if its connected via ethernet cable, then via the wired route. It is able to do</p>
<p><strong>Break-Down of how router knows device to transfer the package to</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769607021716/16ce65f6-65ec-4b3f-877c-0867e93dd004.png" alt /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769607065526/e3748c61-e182-40da-ba13-f25c65e93036.png" alt /></p>
<p>Now lets dive Into Switches and Hubs Switches and Hubs are two types of device that are used for similar work that is to increase the number of device connected to the network via wires. Generally via ethernet cable and RJ45 jack. Although they have the same task they do have some important differences they are :</p>
<p><strong>Switches</strong></p>
<ul>
<li><p>Sends packages to the individual device according to their mac address</p>
</li>
<li><p>More efficient compared to hub</p>
</li>
<li><p>More secured compared to hub <strong>Hub</strong></p>
</li>
<li><p>Sends packages to all the devices in the network</p>
</li>
<li><p>Less efficient and less secured compared to switch</p>
</li>
<li><p>More affordable compared to switch</p>
</li>
</ul>
<p><strong>FireWall</strong></p>
<p>Like the name suggests firewall is a barrier between the internet and you home network or computer. Traditionally it used to be an actual hardware that used to scan each and every package for malicious code or a malicious sender. Nowadays a software is used which runs either on the router level or the actual device level. Firewall responsibility is to protect the end user from the malicious actors from the internet.</p>
<p><strong>Load Balancers</strong></p>
<p>Imagine you are deploying your next big project <strong>Tinder but for dogs</strong>. Its a huge success and you have hundreds of millions of users. You can only process so much request from a single computer as a server. You may thinking of increasing the capacity of the server by adding extra ram, storage or even upgrading the processor <strong>(Vertical Scaling)</strong> . But at a point in time you will realize this is to expensive and is not feasible. The next solution is to spin up another computer now u have double the capacity of handling request <strong>(Horizontal Scaling)</strong> . But you will need a mechanism to ensure that the requests are divided into the multiple server instances so you wont have one server running at maximum capacity and the other one hardly getting any traffic.</p>
<p>To solve this issue load Balancers are user. They are responsible for distributing traffic among the available serve instances. And ensuring that each server instance is healthy. Incase of error it redirects traffic to other healthy server instances.</p>
<p><strong>Conclusion</strong></p>
<p>In real world scenario all these technologies work together to ensure that the internet functions and you can enjoy you cat videos in youtube without a hacker getting your bank details or social security info. When u click on that cat video the request goes from Your device -&gt; switch/ hub -&gt; router -&gt; modem -&gt; global network of optical fiber and satellites -&gt; youtube servers -&gt; load balancers -&gt; actual device that process the request Then the response travels back all the way from the same path back to your modem -&gt; router -&gt; firewall and finally your Device so you can enjoy your cat videos.</p>
]]></content:encoded></item><item><title><![CDATA[Inside Git How it works and the role of .git Folder]]></title><description><![CDATA[After u initialize a folder with "git init" command, git creates a folder name ".git". As the folder name starts with "." it is hidden in most of the file explorers. It uses that folder to keep track of all the commits and changes you have made. Git ...]]></description><link>https://subedihimal.hashnode.dev/inside-git-how-it-works-and-the-role-of-git-folder</link><guid isPermaLink="true">https://subedihimal.hashnode.dev/inside-git-how-it-works-and-the-role-of-git-folder</guid><category><![CDATA[Git]]></category><category><![CDATA[.git folder]]></category><category><![CDATA[Git branches]]></category><category><![CDATA[git reset]]></category><category><![CDATA[gitrevert]]></category><dc:creator><![CDATA[Himal Subedi]]></dc:creator><pubDate>Fri, 16 Jan 2026 17:14:17 GMT</pubDate><content:encoded><![CDATA[<p>After u initialize a folder with "git init" command, git creates a folder name ".git". As the folder name starts with "." it is hidden in most of the file explorers. It uses that folder to keep track of all the commits and changes you have made. Git keeps track of changes in a similar to how linked list work. Rather then saving all the files and folder as is when a commit is made, it only saves the changes that happed in the file after the previous commit.</p>
<p>Some Key Concepts of git Head -&gt; Latest commit is called head Hash -&gt; Unique id given to each commit</p>
<h2 id="heading-branching-in-git"><strong>Branching in Git</strong></h2>
<p>Branching can be utilized when you are working on a experimental or new feature and only want to update the main version of the project after you have completed the feature.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768583560945/28250c1e-0a41-4685-bcaf-43b2b2725253.png" alt class="image--center mx-auto" /></p>
<p><strong>Exploring git folder structure</strong></p>
<ul>
<li><p>HEAD:</p>
<p>  Stores the data about the branches and what branch is currently being used</p>
</li>
<li><p>refs/heads:</p>
<p>  Stores the hash of the current branch</p>
</li>
<li><p>objects:</p>
<p>  All the changes are stored here with their first two hash code as a folder name for better storage. If u explore into this you will see files with commit hash. Each file includes hash of previous commit, author, commit message and hash of the tree is it part of.</p>
</li>
</ul>
<hr />
<p>Some more complex git commands</p>
<p><strong>Fixing Errors or mistakes in commit</strong></p>
<ul>
<li><p><code>git revert &lt;hash&gt;</code></p>
<p>  Creates a new commit that is negative of the commit u want to revert</p>
</li>
<li><p><code>git reset --hard &lt;hash&gt;</code></p>
<p>  Puts head to the commit mentioned resulting in all the commits after that hash being deleted.</p>
</li>
<li><p><code>git reset &lt;hash&gt;</code> -&gt; without the --hard</p>
<p>  Puts the head to the commit and all the changes after it is kept in the staging area</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Git for Beginners: Basics and Essential Commands]]></title><description><![CDATA[Git is one of the most popular and widely used version control system in the modern coding landscape. Even in a rare chance that some tech companies do not use git they probably use some kind of version control system that is similar to git. So this ...]]></description><link>https://subedihimal.hashnode.dev/git-for-beginners-basics-and-essential-commands</link><guid isPermaLink="true">https://subedihimal.hashnode.dev/git-for-beginners-basics-and-essential-commands</guid><category><![CDATA[Git]]></category><category><![CDATA[Git Commands]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Starting a blog on GitHub]]></category><dc:creator><![CDATA[Himal Subedi]]></dc:creator><pubDate>Thu, 15 Jan 2026 15:38:38 GMT</pubDate><content:encoded><![CDATA[<p>Git is one of the most popular and widely used <strong>version control system</strong> in the modern coding landscape. Even in a rare chance that some tech companies do not use git they probably use some kind of version control system that is similar to git. So this fact makes learning and being familiar with git a non-negotiable necessity for any aspiring coders or software engineers.</p>
<p>Now, although we highlighted the need for learning git. Some more questions may arise in you mind.</p>
<p>How do u actually use git?</p>
<p>How do u tell it what u want to do?</p>
<p>How do u tell git when to save something?</p>
<p>How do u tell git what to track or what amount of code is considered so called "new version"?</p>
<hr />
<p><strong>The answer to this question comes from the concept of Git Commands</strong></p>
<h3 id="heading-git-commands">Git Commands</h3>
<p>Git commands are basically instructions you write to git that tells it what to do. For you to have be able to write git commands first of all u will need to have git installed in your computer. Lets go through some common and widely used git commands and learn what they actually do.</p>
<ol>
<li><p>git init</p>
<p> As the name suggests it initializes git in the directory you run this command at. After git is initialized it is able to keep track of changes u made also you will be able to use other git commands as well. Syntax:</p>
<p> git init</p>
</li>
<li><p>git add</p>
<p> It allows you to add all the changes you have made to staging area. Staging area is the place from where you can commit the changes.</p>
<p> Syntax:</p>
<p> git add -&gt; for adding individual file or directory</p>
<p> git add . -&gt; for adding all the changes of files into the staging area</p>
</li>
<li><p>git commit</p>
<p> Commit lets u create a version for the project. It generates a unique identifier for each commit. So u can go back to a commit you made in the past or see what changes have been made in between two commits. After the commit is done its like saving the changes into git.</p>
<p> You can also use -m flag to write a short message about the particular commit. It is considered good practice to write it in present tense and also to use words like (add, refactor, remove, feat )</p>
<p> Syntax:</p>
<p> git commit -m "Your short description to describe the commit"</p>
</li>
<li><p>git push</p>
<p> This allows you to push the changes to a remote server most popularly used is github. This allows you to have a backup, as well as make the code changes accessible for other collaborators to use.</p>
<p> Syntax:</p>
<p> git push origin main</p>
</li>
<li><p>git log</p>
<p> This displays all the commits that have been made in the past along with their unique identifier, commit message as well as date and time of the commit.</p>
<p> Syntax:</p>
<p> git log</p>
<p> git log --oneline -&gt;For more compact and cleaner output, but removes details like date and author</p>
</li>
<li><p>git diff</p>
<p> This command allows you to see the different changes that occurred between two different commits. It is very useful when u need to know which files were changed and what were the changes between the commits.</p>
<p> Syntax:</p>
<p> git diff &lt;commit id1&gt; &lt;commit id2&gt;</p>
</li>
<li><p>git status</p>
<p> Shows the overall current status of git. What files are stages which are modified after the last commit or which new files have been created and are untracked.</p>
<p> Syntax</p>
<p> git status</p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[Why Version Control Exists - The Pendrive Problem]]></title><description><![CDATA[Why Version Control Exists ?
Lets say, A developer decided to make a personal project. He setup the project in his computer and start writing code. In the beginning the code was of few lines. He didn't have any issue keeping track of what changes he ...]]></description><link>https://subedihimal.hashnode.dev/why-version-control-exists-the-pendrive-problem</link><guid isPermaLink="true">https://subedihimal.hashnode.dev/why-version-control-exists-the-pendrive-problem</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[version control]]></category><category><![CDATA[version control systems]]></category><category><![CDATA[version control for beginners]]></category><dc:creator><![CDATA[Himal Subedi]]></dc:creator><pubDate>Fri, 02 Jan 2026 12:36:38 GMT</pubDate><content:encoded><![CDATA[<h4 id="heading-why-version-control-exists">Why Version Control Exists ?</h4>
<p>Lets say, A developer decided to make a personal project. He setup the project in his computer and start writing code. In the beginning the code was of few lines. He didn't have any issue keeping track of what changes he made, at times when he faced a bug or an error he could easily debug. Everything was working fine at the beginning. After a month or so, his consistency paid off and the project grew to have thousands of lines of code. Now, a new problem arose if he faced a bug or wanted to add some experimental feature, and things didn't work out, he would have hard time changing back all the thousands of lines of code to the time everything worked fine. Finding solution to this problem led to the development and the existence of <strong>version control system</strong>.</p>
<h4 id="heading-the-pendrive-analogy-in-software-development">The Pendrive Analogy in Software Development</h4>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767357327672/a44e19c4-6b43-4074-9f1c-861be57eb0e7.png" alt /></p>
<p>Lets imagine you are working on your next big app "Tinder But for Dogs". The project is a huge success and u need to add a payment feature to earn some money for the hard work. You don't know how to build the payment feature and u ask your good friend Tommy for some help. Now, you have to provide the source code to Tommy. You think for a while and get a brilliant idea to use a USB pen-drive, what could go wrong ? right, Well as brilliant as the solution may sound, like the "Tinder but for dogs" idea u had, here are some problems that may occur.</p>
<ul>
<li><p>You will need to physically move the pen drive from your house to your friends every-time u make and update and vice-versa.</p>
</li>
<li><p>Both you and Tommy wont be able to work on the project in parallel as if u do so there will be two different project with different things implemented and you will have a hard time merging both.</p>
</li>
<li><p>You wont know what changes were made by each other (collaboration history).</p>
</li>
</ul>
<p>So, these were the problem faced before a proper version control system existed</p>
]]></content:encoded></item></channel></rss>