<?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[Git for Beginners]]></title><description><![CDATA[Git for Beginners]]></description><link>https://gitforbeginnersbysarthak.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 11 Oct 2026 09:47:12 GMT</lastBuildDate><atom:link href="https://gitforbeginnersbysarthak.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Git For Beginners]]></title><description><![CDATA[What is Git ??
Git is a distributive version control system which is a technical term of tracker.Git stands for “Global Information Tracker“.It is a tracers which stores information like what is updated and by whom in any particular project or file e...]]></description><link>https://gitforbeginnersbysarthak.hashnode.dev/git-for-beginners</link><guid isPermaLink="true">https://gitforbeginnersbysarthak.hashnode.dev/git-for-beginners</guid><category><![CDATA[Git]]></category><category><![CDATA[version control]]></category><category><![CDATA[version control systems]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><dc:creator><![CDATA[Sarthak singh]]></dc:creator><pubDate>Fri, 16 Jan 2026 17:58:35 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-what-is-git">What is Git ??</h2>
<p>Git is a distributive <em>version control system</em> which is a technical term of tracker.<br />Git stands for “<em>Global Information Tracker</em>“.<br />It is a tracers which stores information like what is updated and by whom in any particular project or file etc., to enhance collaboration between peers. for sake of your understanding you can assume like it takes snapshot of your code and stores it in a separate special folder.</p>
<hr />
<h2 id="heading-why-git-is-used">Why Git is used ??</h2>
<p>It records snapshot of project/code and allow us to revert(it creates an invers file) in the file.<br />Git allows user / developer to work on any project simultaneously, the technical term we use for this in git is ‘branching’.<br />Every developer have the copy of file in their machine even if the device is offline.</p>
<hr />
<h2 id="heading-basics-and-core-technologies-of-git">Basics and Core Technologies of Git</h2>
<ul>
<li><p><strong>Repository</strong> also known as Repo , it is a place or a digital container which stores entire version history of file on which we are working. The folder in which version history is stored is named “.git” , this folder is hidden and cannot accessed directly. It acts as the control hub that allows to track, manage, and collaborate on your code over time.</p>
</li>
<li><p><strong>Commit</strong> is a "snapshot" of all files currently in the staging area.<br />  You create a repository via add command once to start tracking a project at starting, and you create many commits within it to save your progress as you work. </p>
</li>
<li><p><strong>Branch</strong> is linked list which takes previous commit as a reference to show what is modified in current one. There is a primary branch which is known as ‘main‘ branch, we can create multiple sub-branches and connect it with main branch.</p>
</li>
<li><p><strong>HEAD</strong> is a pointer which indicated current location. Whenever we commit our file in git, it shifts the head pointer to the latest node of linked list.</p>
</li>
<li><p><strong>Staging Area</strong> also known as index is temporary place which hold the changes before committing it or it is a place where new repo is created whenever we add file.</p>
</li>
</ul>
<hr />
<h2 id="heading-git-commands">Git Commands</h2>
<ul>
<li><p><code>git init</code> -it initializes a new repository</p>
</li>
<li><p><code>git add &lt;file name&gt;</code> - It adds file to stage area</p>
</li>
<li><p><code>git add.</code> - it add all the file on that folder</p>
</li>
<li><p><code>git commit -m “message“</code> - it saves changes permanently</p>
</li>
<li><p><code>git commit -am “message“</code> - it add all files in staging area and save changes permanently</p>
</li>
<li><p><code>git status</code> - It tells us about status of file (e.g., modified, new add)</p>
</li>
<li><p><code>git log</code> -This command tells commit history</p>
</li>
<li><p><code>git log -a</code> - It gives small output of commit history</p>
</li>
<li><p><code>git diff &lt;from Hash&gt; &lt;To Hash&gt;</code> - Gives output what have changed</p>
</li>
<li><p><code>git revert &lt;Hash&gt;</code> - This command creates a new file with opposite</p>
</li>
<li><p><code>git reset --hard &lt;Hash&gt;</code> - It shifts HEAD pointer to hash and rest branch will be deleted(No history is saved)</p>
</li>
<li><p><code>git reset &lt;Hash&gt;</code> - It shifts HEAD pointer to hash and rest branch will be moved to staging area</p>
</li>
<li><p><code>git cat -file -p &lt;Hash&gt;</code> -It gives whole the content in the file</p>
</li>
<li><p><code>git branch</code> - It returns current branch name</p>
</li>
</ul>
<h2 id="heading-basics-developer-workflow">Basics developer workflow</h2>
<ol>
<li><p><strong>Initialize:</strong> Open your project folder in a terminal and run <code>git init</code> to start tracking.</p>
</li>
<li><p><strong>Work:</strong> Create or edit your files (e.g., <code>index.html</code>).</p>
</li>
<li><p><strong>Stage:</strong> Use <code>git add .</code> to prepare all changed files for a snapshot.</p>
</li>
<li><p><strong>Commit:</strong> Use <code>git commit -m "Initial commit"</code> to save your progress.</p>
</li>
</ol>
]]></content:encoded></item></channel></rss>