<?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://gitfor-beginners.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 19:30:51 GMT</lastBuildDate><atom:link href="https://gitfor-beginners.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Git for Beginners: Basics and Essential Commands]]></title><description><![CDATA[What is Git?
Git is a version control system that maintains track of the project. It makes switching between various versions of the project. It helps in undoing errors and modifications.
Why We Use Git?
Git is a version control system. If we make a ...]]></description><link>https://gitfor-beginners.hashnode.dev/git-for-beginners-basics-and-essential-commands</link><guid isPermaLink="true">https://gitfor-beginners.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><category><![CDATA[MERN Stack]]></category><dc:creator><![CDATA[Mohd Asif]]></dc:creator><pubDate>Sat, 17 Jan 2026 13:27:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768652921428/4f61c3c1-ba23-4dde-837b-b6d14d4944f1.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-is-git"><strong>What is Git?</strong></h2>
<p>Git is a version control system that maintains track of the project. It makes switching between various versions of the project. It helps in undoing errors and modifications.</p>
<h2 id="heading-why-we-use-git"><strong>Why We Use Git?</strong></h2>
<p>Git is a version control system. If we make a mistake, we can't undo it without a version control system. We're losing track of what we changed. We can still handle these things when we're working alone, but it will be a mess when we work with other people on the same job. The other person can't see what and where we've changed, and none of us can see what and where they have changed.</p>
<ul>
<li><p>It keeps the project on track.</p>
</li>
<li><p>We can revert the changes.</p>
</li>
<li><p>Helps in collaboration work</p>
</li>
</ul>
<h2 id="heading-core-terminologies">Core Terminologies</h2>
<h3 id="heading-repository-repo">Repository (repo)</h3>
<p>A repository is a complete folder that contains the entire project as well as its Git history.</p>
<h3 id="heading-commit"><strong>Commit</strong></h3>
<p>Commit is basically saving the changes to the files.</p>
<h3 id="heading-branch"><strong>Branch</strong></h3>
<p>The branch is like a separate workspace where we can make changes and try new ideas without affecting the main project.</p>
<h3 id="heading-head">Head</h3>
<p>Head <strong>is a special pointer that acts as a reference to the commit I am currently working on</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768654563533/da109f72-56ef-40cb-b2d7-d7eb08f8404e.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-common-git-commands">Common Git Commands</h2>
<h3 id="heading-git-init">git init</h3>
<p>git init creates a repository along with the .git folder, which is responsible for tracking the changes in the project files.</p>
<pre><code class="lang-bash">git init <span class="hljs-comment">#Initialize the repository</span>
</code></pre>
<h3 id="heading-git-add">git add</h3>
<p>git add stages the changes and prepares them for the commit.</p>
<pre><code class="lang-bash">git add filename <span class="hljs-comment">#add only one untracked and modified file</span>
git add . <span class="hljs-comment">#add all untracked and modified files</span>
</code></pre>
<h3 id="heading-git-commit"><strong>git commit</strong></h3>
<p>Save the changes permanently.</p>
<pre><code class="lang-bash">git commit -m<span class="hljs-string">"commit message"</span> <span class="hljs-comment">#It commits all the changes</span>
</code></pre>
<h3 id="heading-git-log"><strong>git log</strong></h3>
<p>It shows the history of commits.</p>
<pre><code class="lang-bash">git <span class="hljs-built_in">log</span>
</code></pre>
<h3 id="heading-git-status"><strong>git status</strong></h3>
<p>git status shows what is going on right now in the repo.</p>
<pre><code class="lang-bash">git status <span class="hljs-comment">#Show the status</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768655788247/0b18cd78-914d-4817-b4f8-3ad598ceee4c.png" alt="Local" class="image--center mx-auto" /></p>
<h2 id="heading-frequently-used-git-commands">Frequently Used Git Commands</h2>
<pre><code class="lang-bash">git status <span class="hljs-comment">#Check the status of unstaged changes</span>
git init <span class="hljs-comment">#Initialize a new Git repository</span>
git add filename or 
git add .    <span class="hljs-comment"># Stage files for commit</span>
git commit -m <span class="hljs-string">"Your message here"</span> <span class="hljs-comment">#Commit local with a meaningful message</span>
git push origin main <span class="hljs-comment"># Push changes to remote</span>
git <span class="hljs-built_in">log</span> <span class="hljs-comment">#View commit history</span>
</code></pre>
]]></content:encoded></item></channel></rss>