<?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[Variables and DataTypes in JavaScript ]]></title><description><![CDATA[Variables and DataTypes in JavaScript ]]></description><link>https://mithila-dk-js-variables-datatypes.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 25 Jun 2026 08:19:55 GMT</lastBuildDate><atom:link href="https://mithila-dk-js-variables-datatypes.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Understanding Variables and Data Types in JavaScript]]></title><description><![CDATA[Topics to Cover

What variables are and why they are needed

How to declare variables using var, let and const

Primitive data types (string, number, boolean, null, undefined)

Basic difference betwee]]></description><link>https://mithila-dk-js-variables-datatypes.hashnode.dev/understanding-variables-and-data-types-in-javascript</link><guid isPermaLink="true">https://mithila-dk-js-variables-datatypes.hashnode.dev/understanding-variables-and-data-types-in-javascript</guid><category><![CDATA[js variables]]></category><category><![CDATA[js data type]]></category><category><![CDATA[chaicode webdev cohort 2026]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Mithila Dk]]></dc:creator><pubDate>Mon, 02 Mar 2026 09:50:34 GMT</pubDate><content:encoded><![CDATA[<p>Topics to Cover</p>
<ol>
<li><p>What variables are and why they are needed</p>
</li>
<li><p>How to declare variables using <code>var, let and const</code></p>
</li>
<li><p>Primitive data types (string, number, boolean, null, undefined)</p>
</li>
<li><p>Basic difference between <code>var</code>, <code>let</code>, and <code>const</code></p>
</li>
<li><p>What is scope (very beginner-friendly explanation)</p>
</li>
</ol>
<p>When we begin learning JavaScript, the very first building block we encounter is <strong>variables</strong>.</p>
<p>Every program needs to store information — names, numbers, user inputs, or even true/false values.<br />In JavaScript, we store this information using variables.</p>
<p>Let’s understand this clearly and step by step</p>
<h2>What is a Variable?</h2>
<p>A <strong>variable</strong> is a named container used to store data in memory.</p>
<p>Imagine you are moving into a new house. You have a lot of items—books, clothes, and kitchenware. To keep things organized, you put them into <strong>boxes</strong> and put a <strong>label</strong> on each box.</p>
<p>Think of it like a labeled box:</p>
<ol>
<li><p>The label is the variable name.</p>
</li>
<li><p>The box is the variable.</p>
</li>
<li><p>The content inside the box is the value.</p>
</li>
<li><p>JavaScript stores this inside memory while the program runs.</p>
</li>
</ol>
<p>Without variables, we would not be able to store or reuse information in our programs.</p>
<h2>How to Declare Variables in JavaScript</h2>
<p>JavaScript provides three keywords to declare variables:</p>
<ul>
<li><p>var</p>
</li>
<li><p>let</p>
</li>
<li><p>const</p>
</li>
</ul>
<h3>Var</h3>
<p><strong>var</strong> is the older way of declaring variables.</p>
<pre><code class="language-javascript">var age = 25;
age = 30; // value can be changed
</code></pre>
<p><strong>Key Points:</strong></p>
<ul>
<li><p>Value can be reassigned.</p>
</li>
<li><p>Variable can be redeclared.</p>
</li>
<li><p>It does not follow block scope properly.</p>
</li>
</ul>
<p>Because of scope-related issues, <em>var</em> is generally avoided in modern JavaScript.</p>
<h3>Let</h3>
<p><strong>let</strong> is used when the value may change later.</p>
<pre><code class="language-javascript">let city = "Delhi";
city = "Bangalore"; // allowed 
</code></pre>
<p><strong>Key Points:</strong></p>
<ul>
<li><p>Value can be reassigned.</p>
</li>
<li><p>Cannot be redeclared in the same scope.</p>
</li>
<li><p>Follows block scope.</p>
</li>
</ul>
<p>Most modern JavaScript code prefers <em><strong>let</strong></em>.</p>
<h3>Const</h3>
<p><strong>const</strong> is used when the value should not change(like your birth date). Short for "constant."</p>
<img src="https://cdn.hashnode.com/uploads/covers/696f304bc3ffcbb856137e02/a4479253-8fe7-4cb0-a226-d878bf41003a.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Key Points:</strong></p>
<ul>
<li><p>Cannot be reassigned.</p>
</li>
<li><p>Cannot be redeclared.</p>
</li>
<li><p>Follows block scope.</p>
</li>
</ul>
<p><strong>Best practice:</strong></p>
<p>Use <em><strong>const</strong></em> by default. Use <em><strong>let</strong></em> only when the value needs to change.</p>
<table>
<thead>
<tr>
<th>Feature</th>
<th>var</th>
<th>let</th>
<th>const</th>
</tr>
</thead>
<tbody><tr>
<td>Scope</td>
<td>Function</td>
<td>Block</td>
<td>Block</td>
</tr>
<tr>
<td>Reassignment</td>
<td>yes</td>
<td>yes</td>
<td>no</td>
</tr>
<tr>
<td>Redeclaration</td>
<td>yes</td>
<td>no</td>
<td>no</td>
</tr>
</tbody></table>
<h2>Types of Data in JavaScript</h2>
<p>In JavaScript, data types are broadly divided into two categories:</p>
<ol>
<li><p><strong>Primitive Data Types</strong></p>
</li>
<li><p><strong>Non-Primitive Data Types</strong></p>
</li>
</ol>
<p>JavaScript supports different kinds of data. In this article, we will focus on the most basic and commonly used types.</p>
<h3>Primitive Data Types</h3>
<p>Variables can store different kinds of values. These basic types are known as <strong>primitive data types</strong>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/696f304bc3ffcbb856137e02/fa895f33-d5c2-4b1e-99ad-37c41bc902b4.png" alt="" style="display:block;margin:0 auto" />

<h3>1. String(Text)</h3>
<p>Anything inside quotes (<code>""</code> or <code>''</code>) is a String.</p>
<p><strong>Real-world use:</strong> Storing a username, a street address, or a tweet.</p>
<h3>Important Characteristics</h3>
<ul>
<li><p>Strings are <strong>primitive and immutable</strong> — once created, their content cannot be changed.</p>
</li>
<li><p>Methods like <code>toUpperCase()</code> return a new string instead of modifying the original.</p>
</li>
<li><p>JavaScript does <strong>not</strong> have a separate character type; a single character is simply a string of length 1.</p>
</li>
<li><p>Strings are <strong>indexable (read-only)</strong>.</p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/696f304bc3ffcbb856137e02/3fe94cf2-a258-4dd8-a5a9-80fa68578296.png" alt="" style="display:block;margin:0 auto" />

<h3>2. Number</h3>
<p>The <strong>number</strong> type represents both integers and decimal values.</p>
<pre><code class="language-javascript">let age = 25;
let price = 99.99;
</code></pre>
<p>JavaScript does not differentiate between integers and floating-point numbers — both are simply numbers.</p>
<h3>3. Boolean.</h3>
<p>A <strong>boolean</strong> represents logical values: True or False (Think of it like a light switch-only two states).It is mostly used in decision-making.</p>
<pre><code class="language-javascript">let isLoggedIn = true;
let hasPermission = false;

console.log(isLoggedIn);   // true
console.log(hasPermission); // false

let age = 20;
let isAdult = age &gt;= 18;

console.log(isAdult); // true
</code></pre>
<p>Boolean values are often the result of <strong>comparisons</strong>.</p>
<h3>4. Undefined.</h3>
<p>A variable has been declared, but no value has been assigned yet. When we declare a variable without initializing it, JavaScript automatically stores undefined in it.</p>
<p>( Imagine reserving a box but not putting anything inside it yet. The box exists but it is empty.)</p>
<pre><code class="language-javascript">let score;

console.log(score); // undefined
</code></pre>
<ul>
<li>Memory is created for score. Since no value is assigned, JavaScript sets it to. Undefined is real value.</li>
</ul>
<h3>5. Null.</h3>
<p>The variable intentionally has no value.</p>
<p>Unlike undefined, null is explicitly assigned by the developer.</p>
<pre><code class="language-javascript">let selectedUser = null;

console.log(selectedUser); // null

console.log(typeof null); // "object"
</code></pre>
<ul>
<li>Memory is created for selectedUser but We deliberately store null inside it. It represents an intentional absence of value.</li>
</ul>
<h3>Understanding Scope</h3>
<pre><code class="language-javascript">+----------------------------------+
|        Global Scope              |
|                                  |
|   +--------------------------+   |
|   |       Block Scope        |   |
|   |                          |   |
|   |   let / const → inside   |   |
|   +--------------------------+   |
|                                  |
|   var → accessible outside block |
+----------------------------------+
</code></pre>
<p>After declaring variables, an important concept to understand is <strong>scope</strong>. It determines where a variable can be accessed in the program.</p>
<p><strong>Not every variable is accessible everywhere.</strong></p>
<p><strong>Global Scope</strong></p>
<p>If a variable is declared outside any block or function, it becomes globally accessible.</p>
<img src="https://cdn.hashnode.com/uploads/covers/696f304bc3ffcbb856137e02/c5c47467-e37a-4a3d-ab6b-99fe034c0223.png" alt="" style="display:block;margin:0 auto" />

<p>greeting is declared outside the function. So it can be used anywhere in the program.</p>
<p><strong>Block Scope</strong></p>
<p>If a variable is declared inside <code>{ }</code>,it can only be used inside that block.</p>
<pre><code class="language-javascript">{
  let age = 25;
  console.log(age); // 25
}

console.log(age); // Error
</code></pre>
<p>age exists only inside the block Outside the block, it does not exist</p>
<h2>Important Note</h2>
<ul>
<li><p>let and const follow block scope.</p>
</li>
<li><p>var does not properly respect block boundaries.</p>
</li>
</ul>
<p>That’s why in modern JavaScript, we prefer let and const.</p>
<h3>Conclusion</h3>
<p>In this article, we explored one of the most fundamental concepts in JavaScript — variables.</p>
<p>We learned how to declare variables using let, const and var, and understood when to use each of them. We also explored primitive data types like string , number, boolean , undefined and null along with how they behave in memory.</p>
<p>Understanding variables is not just about syntax. It’s about knowing:</p>
<ul>
<li><p>How data is stored</p>
</li>
<li><p>How values can change</p>
</li>
<li><p>Where variables can be accessed (scope)</p>
</li>
<li><p>And how JavaScript handles uninitialized or empty values</p>
</li>
</ul>
<p>These concepts may seem simple at first, but they form the backbone of every JavaScript program — whether it's a small script or a large application.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding Variables and Data Types in JavaScript]]></title><description><![CDATA[What variables are and why they are needed

How to declare variables using var, let and const

Primitive data types (string, number, boolean, null, undefined)

Basic difference between var, let, and c]]></description><link>https://mithila-dk-js-variables-datatypes.hashnode.dev//understanding-variables-and-datatypes-in-javascript</link><guid isPermaLink="true">https://mithila-dk-js-variables-datatypes.hashnode.dev//understanding-variables-and-datatypes-in-javascript</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[variable declaration]]></category><category><![CDATA[js data type]]></category><dc:creator><![CDATA[Mithila Dk]]></dc:creator><pubDate>Wed, 25 Feb 2026 18:04:54 GMT</pubDate><content:encoded><![CDATA[<ol>
<li><p>What variables are and why they are needed</p>
</li>
<li><p>How to declare variables using <code>var, let and const</code></p>
</li>
<li><p>Primitive data types (string, number, boolean, null, undefined)</p>
</li>
<li><p>Basic difference between <code>var</code>, <code>let</code>, and <code>const</code></p>
</li>
<li><p>What is scope (very beginner-friendly explanation)</p>
</li>
</ol>
<p>When we begin learning JavaScript, the very first building block we encounter is <strong>variables</strong>.</p>
<p>Every program needs to store information — names, numbers, user inputs, or even true/false values.<br />In JavaScript, we store this information using variables.</p>
<p>Let’s understand this clearly and step by step.</p>
<h2>What is a Variable?</h2>
<p>A <strong>variable</strong> is a named container used to store data in memory.</p>
<p>Imagine you are moving into a new house. You have a lot of items—books, clothes, and kitchenware. To keep things organized, you put them into <strong>boxes</strong> and put a <strong>label</strong> on each box.</p>
<p>Think of it like a labeled box:</p>
<ol>
<li><p>The label is the variable name.</p>
</li>
<li><p>The box is the variable.</p>
</li>
<li><p>The content inside the box is the value.</p>
</li>
<li><p>JavaScript stores this inside memory while the program runs.</p>
</li>
</ol>
<p>Without variables, we would not be able to store or reuse information in our programs.</p>
<h2>How to Declare Variables in JavaScript</h2>
<p>JavaScript provides three keywords to declare variables:</p>
<ul>
<li><p>var</p>
</li>
<li><p>let</p>
</li>
<li><p>const</p>
</li>
</ul>
<h3>Var</h3>
<p><strong>var</strong> is the older way of declaring variables.</p>
<pre><code class="language-javascript">var age = 25;
age = 30; // value can be changed
</code></pre>
<p><strong>Key Points:</strong></p>
<ul>
<li><p>Value can be reassigned.</p>
</li>
<li><p>Variable can be redeclared.</p>
</li>
<li><p>It does not follow block scope properly.</p>
</li>
</ul>
<p>Because of scope-related issues, <em>var</em> is generally avoided in modern JavaScript.</p>
<h3>Let</h3>
<p><strong>let</strong> is used when the value may change later.</p>
<pre><code class="language-javascript">let city = "Delhi";
city = "Bangalore"; // allowed 
</code></pre>
<p><strong>Key Points:</strong></p>
<ul>
<li><p>Value can be reassigned.</p>
</li>
<li><p>Cannot be redeclared in the same scope.</p>
</li>
<li><p>Follows block scope.</p>
</li>
</ul>
<p>Most modern JavaScript code prefers <em><strong>let</strong></em>.</p>
<h3>Const</h3>
<p><strong>const</strong> is used when the value should not change(like your birth date). Short for "constant."</p>
<img src="https://cdn.hashnode.com/uploads/covers/696f304bc3ffcbb856137e02/86784125-a831-498b-9056-361efb0662e9.png" alt="" style="display:block;margin:0 auto" />

<p><strong>Key Points:</strong></p>
<ul>
<li><p>Cannot be reassigned.</p>
</li>
<li><p>Cannot be redeclared.</p>
</li>
<li><p>Follows block scope.</p>
</li>
</ul>
<p><strong>Best practice:</strong></p>
<p>Use <em><strong>const</strong></em> by default. Use <em><strong>let</strong></em> only when the value needs to change.</p>
<table style="min-width:100px"><colgroup><col style="min-width:25px"></col><col style="min-width:25px"></col><col style="min-width:25px"></col><col style="min-width:25px"></col></colgroup><tbody><tr><th><p>Feature</p></th><th><p>var</p></th><th><p>let</p></th><th><p>const</p></th></tr><tr><td><p>Scope</p></td><td><p>Function</p></td><td><p>Block</p></td><td><p>Block</p></td></tr><tr><td><p>Reassignment</p></td><td><p>yes</p></td><td><p>yes</p></td><td><p>no</p></td></tr><tr><td><p>Redeclaration</p></td><td><p>yes</p></td><td><p>no</p></td><td><p>no</p></td></tr></tbody></table>

<h2>Types of Data in JavaScript</h2>
<p>In JavaScript, data types are broadly divided into two categories:</p>
<ol>
<li><p><strong>Primitive Data Types</strong></p>
</li>
<li><p><strong>Non-Primitive Data Types</strong></p>
</li>
</ol>
<p>JavaScript supports different kinds of data. In this article, we will focus on the most basic and commonly used types.</p>
<h3>Primitive Data Types</h3>
<p>Variables can store different kinds of values. These basic types are known as <strong>primitive data types</strong>.</p>
<img src="https://cdn.hashnode.com/uploads/covers/696f304bc3ffcbb856137e02/8cdd54c3-5830-4e5b-84c6-2b4ed280c9bb.png" alt="" style="display:block;margin:0 auto" />

<h3>1. String(Text)</h3>
<p>Anything inside quotes (<code>""</code> or <code>''</code>) is a String.</p>
<p><strong>Real-world use:</strong> Storing a username, a street address, or a tweet.</p>
<h3>Important Characteristics</h3>
<ul>
<li><p>Strings are <strong>primitive and immutable</strong> — once created, their content cannot be changed.</p>
</li>
<li><p>Methods like <code>toUpperCase()</code> return a new string instead of modifying the original.</p>
</li>
<li><p>JavaScript does <strong>not</strong> have a separate character type; a single character is simply a string of length 1.</p>
</li>
<li><p>Strings are <strong>indexable (read-only)</strong>.</p>
</li>
<li><img src="https://cdn.hashnode.com/uploads/covers/696f304bc3ffcbb856137e02/1286abd6-eb96-4c45-9fbb-801221953afe.png" alt="" style="display:block;margin:0 auto" /></li>
</ul>
<h3>2. Number</h3>
<p>The <strong>number</strong> type represents both integers and decimal values.</p>
<pre><code class="language-javascript">let age = 25;
let price = 99.99;
</code></pre>
<p>JavaScript does not differentiate between integers and floating-point numbers — both are simply numbers.</p>
<h3>3. Boolean.</h3>
<p>A <strong>boolean</strong> represents logical values: True or False (Think of it like a light switch-only two states).It is mostly used in decision-making.</p>
<pre><code class="language-javascript">let isLoggedIn = true;
let hasPermission = false;

console.log(isLoggedIn);   // true
console.log(hasPermission); // false

let age = 20;
let isAdult = age &gt;= 18;

console.log(isAdult); // true
</code></pre>
<p>Boolean values are often the result of <strong>comparisons</strong>.</p>
<h3>4. Undefined.</h3>
<p>A variable has been declared, but no value has been assigned yet. When we declare a variable without initializing it, JavaScript automatically stores undefined in it.</p>
<p>( Imagine reserving a box but not putting anything inside it yet. The box exists but it is empty.)</p>
<pre><code class="language-javascript">let score;

console.log(score); // undefined
</code></pre>
<ul>
<li>Memory is created for score. Since no value is assigned, JavaScript sets it to. Undefined is real value.</li>
</ul>
<h3>5. Null.</h3>
<p>The variable intentionally has no value.</p>
<p>Unlike undefined, null is explicitly assigned by the developer.</p>
<pre><code class="language-javascript">let selectedUser = null;

console.log(selectedUser); // null

console.log(typeof null); // "object"
</code></pre>
<ul>
<li>Memory is created for selectedUser but We deliberately store null inside it. It represents an intentional absence of value.</li>
</ul>
<h3>Understanding Scope</h3>
<pre><code class="language-plaintext">+----------------------------------+
|        Global Scope              |
|                                  |
|   +--------------------------+   |
|   |       Block Scope        |   |
|   |                          |   |
|   |   let / const → inside   |   |
|   +--------------------------+   |
|                                  |
|   var → accessible outside block |
+----------------------------------+
</code></pre>
<p>After declaring variables, an important concept to understand is <strong>scope</strong>. It determines where a variable can be accessed in the program.</p>
<p><strong>Not every variable is accessible everywhere.</strong></p>
<p><strong>Global Scope</strong></p>
<p>If a variable is declared outside any block or function, it becomes globally accessible.</p>
<img src="https://cdn.hashnode.com/uploads/covers/696f304bc3ffcbb856137e02/459cc89f-ceaa-45db-804f-0312d45e888a.png" alt="" style="display:block;margin:0 auto" />

<p>greeting is declared outside the function. So it can be used anywhere in the program.</p>
<p><strong>Block Scope</strong></p>
<p>If a variable is declared inside <code>{ }</code>,it can only be used inside that block.</p>
<pre><code class="language-javascript">{
  let age = 25;
  console.log(age); // 25
}

console.log(age); // Error
</code></pre>
<p>age exists only inside the block Outside the block, it does not exist</p>
<h2>Important Note</h2>
<ul>
<li><p>let and const follow block scope.</p>
</li>
<li><p>var does not properly respect block boundaries.</p>
</li>
</ul>
<p>That’s why in modern JavaScript, we prefer let and const.</p>
<h3>Conclusion</h3>
<p>In this article, we explored one of the most fundamental concepts in JavaScript — variables.</p>
<p>We learned how to declare variables using let, const and var, and understood when to use each of them. We also explored primitive data types like string , number, boolean , undefined and null along with how they behave in memory.</p>
<p>Understanding variables is not just about syntax. It’s about knowing:</p>
<ul>
<li><p>How data is stored</p>
</li>
<li><p>How values can change</p>
</li>
<li><p>Where variables can be accessed (scope)</p>
</li>
<li><p>And how JavaScript handles uninitialized or empty values</p>
</li>
</ul>
<p>These concepts may seem simple at first, but they form the backbone of every JavaScript program — whether it's a small script or a large application.</p>
]]></content:encoded></item><item><title><![CDATA[Git for Beginners: Basics and Essential Commands]]></title><description><![CDATA[Table Of Contents

What is Git

Why Git is Used

Git Basics and Core Terminologies

Common Git Commands


Have you ever edited a file Google Docs, saved it, and then wished you could go back to the previous version?
Or maybe you tried something new i...]]></description><link>https://mithila-dk-js-variables-datatypes.hashnode.dev/git-for-beginners-basics-and-essential-commands</link><guid isPermaLink="true">https://mithila-dk-js-variables-datatypes.hashnode.dev/git-for-beginners-basics-and-essential-commands</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[version control]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Mithila Dk]]></dc:creator><pubDate>Fri, 23 Jan 2026 15:26:50 GMT</pubDate><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769062439978/8438c082-3c90-431d-901d-f6797f52eb3a.png" alt class="image--center mx-auto" /></p>
<h1 id="heading-table-of-contents">Table Of Contents</h1>
<ol>
<li><p><strong>What is Git</strong></p>
</li>
<li><p><strong>Why Git is Used</strong></p>
</li>
<li><p><strong>Git Basics and Core Terminologies</strong></p>
</li>
<li><p><strong>Common Git Commands</strong></p>
</li>
</ol>
<p>Have you ever edited a file Google Docs, saved it, and then wished you could go back to the previous version?</p>
<p>Or maybe you tried something new in your project and suddenly everything broke—and you didn’t remember what the “working” version looked like?</p>
<p>In tools like Google Docs we have <strong>Version History</strong>. You can see the different editing there like what time and which day the page is edited and the data also.</p>
<p>That is exactly the kind of problem Git solves for developers.</p>
<p>It remembers what your project looked like yesterday, last week, or even months ago. You can experiment freely, make mistakes, and always come back.</p>
<h2 id="heading-what-is-git">What is GIT?</h2>
<p>Git is a <strong>“Distributed Version Control system”</strong> .</p>
<ul>
<li><p><strong>Version Control</strong> means it keeps track of the changes we made to the code and tracking who made the changes.</p>
</li>
<li><p><strong>Distributed</strong> means it is distributed in the group like every developer has a full copy of project history in their computer.</p>
</li>
</ul>
<p>Now let’s understand a bit about “<strong>GitHub</strong>”</p>
<p>Git works locally on your computer—it tracks changes, saves versions, and lets you experiment safely. But GitHub(online service) is a <strong>cloud-based platform</strong> where you can store your Git projects online. GitHub allows developers to collaborate, share code, review changes, and back up their work. It also makes teamwork easy by letting multiple people work on the same project from different places.</p>
<h2 id="heading-why-git-is-used">Why GIT is used?</h2>
<ul>
<li><p>It helps to track every change in your project, so we always know <strong><em>what</em></strong> changed and <strong><em>when</em></strong> .</p>
</li>
<li><p>It lets you <strong>undo mistakes safely</strong>. If something breaks, you can go back to a previous working version.</p>
</li>
<li><p>It makes <strong>teamwork easy to manage</strong> . Multiple people can work on the same project without overwriting each other’s work.</p>
</li>
</ul>
<p>Git is used because projects requirements will keep on changing. Code is written, edited, deleted, and improved every day. So system like GIT helps to manage.</p>
<h2 id="heading-git-basics-and-core-terminologies"><strong>Git Basics and Core Terminologies</strong></h2>
<p>Lets understand some of the Core Terminologies in GIT.</p>
<ol>
<li><p><strong>Repository(Repo) :</strong> A <strong>repository</strong> is a storage space where your project's files and their history are kept. It can be local (on your computer) or remote (on a server like GitHub).</p>
</li>
<li><p><strong>Commit</strong> : A <strong>commit</strong> represents a snapshot of your repository — like a version of your project at a particular time . Each commit has:</p>
<ul>
<li><p>A unique identifier</p>
</li>
<li><p>A commit message</p>
</li>
<li><p>A record of changes</p>
</li>
</ul>
</li>
<li><p><strong>Clone</strong> : <strong>Cloning</strong> is the process of creating a copy of a remote repository on your local machine.</p>
</li>
<li><p><strong>Branch : Branch</strong> is like a seperate copy of the repository where we work on feature development, bug fixes etc. Branches allow you to work on different parts of a project without affecting the main branch.</p>
</li>
<li><p><strong>Head</strong> : <strong>Head</strong> points to the current commit you are working on.</p>
</li>
<li><p><strong>Working Directory</strong>: The directory that contains all the files that are tracked by Git.</p>
</li>
<li><p><strong>Staging Area (Index)</strong>: A place where you can see changes before committing them.</p>
</li>
<li><p><strong>Repository (HEAD)</strong>: The Git repository is the place where the files are stored. Git Repository has a directory structure</p>
</li>
</ol>
<p>The diagram below shows how your files move from your computer to Git’s history.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769167398980/16ae3ac3-2fcf-4df3-8220-bb6460d96cb3.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-git-basic-commands">GIT Basic Commands</h3>
<ol>
<li><strong>git init</strong> : Creates a new .git folder in your current directory. This turns any folder into a Git repository</li>
</ol>
<p>Below I have attached screenshots of how to create a new repository and clone it and then Initialize the empty repository.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769174013423/dba34e5d-2df2-4061-9b0e-e0a5b1530d23.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769174216884/d0a9dc47-7f24-4b16-a034-4812f9fa3236.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769173077412/d5ddedd2-f502-40ab-b4d8-0df14debd0ab.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769173158600/9dacb176-2435-463d-a5af-b4b50ab585f1.png" alt class="image--center mx-auto" /></p>
<ol start="2">
<li><p><strong>git clone :</strong> git clone is the command used to download a copy of the repository on to the local machine. I have shown above how to create a repo and then cloning the empty repository. Likewise you can clone any repository on the internet onto your local machine. This will create an exact copy of the existing Git repository with a complete history</p>
</li>
<li><p><strong>git status :</strong> This command is used to display the state of the working directory and the staging area. This shows which files are being tracked by git.</p>
</li>
<li><p><strong>git add</strong> : This command we use in the staging area. In this stage you can select the files we would like to commit. In the below diagram I have used “<strong>git add .”</strong> means to stage the changed files to commit.</p>
</li>
<li><p><strong>git commit</strong> : Commit command is used to save the files in the staging area with the message , all saved history can be found with the given message name.</p>
</li>
<li><p><strong>git push</strong>: Push command is used to add the commits from local repository to the remote repository. Once pushed others will be able to see those changes in the GitHub.</p>
</li>
<li><p><strong>git pull :</strong> Pull command is used to get the changes which are present in the remote repo, It helps to have all the latest code from remote repo on to your local repo.</p>
</li>
<li><p><strong>git log</strong> : This command is used to view the history of the commits in the local repo.</p>
</li>
<li><p><strong>git branch :</strong> A branch creates a separate workspace from the main repository so you can work safely.<br /> It is a copy of the current code where you can make design changes, fix bugs, or add new features without affecting the main branch.<br /> Once your work is complete and tested, you can merge it back into the main branch.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769178188345/8f961657-065c-404e-9431-e8bbc0766578.png" alt class="image--center mx-auto" /></p>
<p>In the below screenshot I have created a new branch and checked out into that new branch. You can find out in the bottom left .</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769179906820/2265b793-7bf1-4fb8-9046-748a60051939.png" alt class="image--center mx-auto" /></p>
<p>you can see a complete Git flow in action — a file is staged, committed with a message, pushed to GitHub, and finally a new branch is created for future work.</p>
<p>This is how you use Git in projects every day.</p>
]]></content:encoded></item></channel></rss>