<?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 Basics and Common Commands]]></title><description><![CDATA[Git Basics and Common Commands]]></description><link>https://git-basics-and-common-commands.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Tue, 06 Oct 2026 06:22:06 GMT</lastBuildDate><atom:link href="https://git-basics-and-common-commands.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[Introduction
If you are a web developer, then Git is a very important tool for you.With the help of Git, we can manage our code, view its history, and work easily with a team.
In this article, we will learn Git at a complete beginner level.
Git
Git i...]]></description><link>https://git-basics-and-common-commands.hashnode.dev/git-for-beginners-basics-and-essential-commands</link><guid isPermaLink="true">https://git-basics-and-common-commands.hashnode.dev/git-for-beginners-basics-and-essential-commands</guid><category><![CDATA[Git]]></category><dc:creator><![CDATA[Akmal Faiz]]></dc:creator><pubDate>Wed, 31 Dec 2025 06:17:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767159628595/2c0c387f-ad82-4ba5-b0f6-5f821442bc47.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>If you are a web developer, then Git is a very important tool for you.<br />With the help of Git, we can manage our code, view its history, and work easily with a team.</p>
<p>In this article, we will learn Git at a complete beginner level.</p>
<h2 id="heading-git">Git</h2>
<p><strong>Git is a Version Control System (VCS). It keeps a record of every change in your project, allowing you to go back to any previous version at any time.<br />Its functions are:</strong></p>
<ul>
<li><p>Tracking changes made in the code</p>
</li>
<li><p>Keeping a backup of the code</p>
</li>
<li><p>Providing the ability to revert to older versions</p>
</li>
</ul>
<h2 id="heading-use-of-git">Use of Git</h2>
<p>• <strong>Security:</strong> If a mistake happens, you can easily return to the previous correct version.<br />• <strong>Clarity:</strong> It tracks who made what changes and when.<br />• <strong>Convenience:</strong> It helps teams easily sync their work and develop new features separately.</p>
<p><strong>Git is a standard tool in the software industry.</strong></p>
<h2 id="heading-git-basics-and-core-terminologies">Git Basics and Core Terminologies</h2>
<p>Repository (Repo):<br />This is the main folder or database of your project, where all project files and their complete history are stored.</p>
<p><strong>Local Repository:</strong><br />The copy that exists on your computer.</p>
<p><strong>Remote Repository:</strong><br />The copy that is hosted on an online server such as GitHub or GitLab, which other team members can also access.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1767161757841/615ae9ef-19aa-4892-9612-a5aeebacfcee.png" alt class="image--center mx-auto" /></p>
<p><strong>Working Directory:</strong><br />This is the place where you write the actual code.<br /> <strong>Meaning:</strong></p>
<ul>
<li><p>HTML, CSS, JS files, txt.</p>
</li>
<li><p>Files that are currently being edited</p>
</li>
</ul>
<p><strong>Staging Area:</strong><br />The staging area is a temporary area.<br /> Here you decide:</p>
<ul>
<li>Which files will go into the commit</li>
</ul>
<p>Files are added here using the git add command.</p>
<p><strong>Commit:</strong><br />A commit means saving the code (a snapshot).<br />Every commit has a message.<br />In the future, this becomes your history.<br />Files are committed using the command:<br />git commit -m "any message"</p>
<p><strong>Branch:</strong><br />A branch is an independent line of development.<br />It allows you to work on a new feature or bug fix separately from the main project, so the main code is not affected.</p>
<p><strong>Merge:</strong><br />When the work on a branch is completed, adding it back into the main branch is called a merge.</p>
<p><strong>Push:</strong><br />Sending code from the local system to GitHub.</p>
<p><strong>Pull:</strong><br />Bringing the latest code from GitHub to your local system.</p>
<h2 id="heading-common-git-commands">Common Git Commands</h2>
<p><strong>Git commands are instructions that tell Git:</strong></p>
<ul>
<li><p>What to do</p>
</li>
<li><p>When to save</p>
</li>
<li><p>Where to send the code</p>
</li>
</ul>
<h3 id="heading-1-git-init">1.  git init</h3>
<p>To start Git in a project:</p>
<p>It creates a hidden folder named .git</p>
<p>It is used only once in each project.</p>
<p><code>git init</code></p>
<h3 id="heading-2-git-status">2. git status</h3>
<p><strong>To check the current status of files:</strong><br />      It tells you:</p>
<ul>
<li><p>Which files are modified</p>
</li>
<li><p>Which files are staged</p>
</li>
<li><p>Which files are untracked</p>
</li>
</ul>
<p><code>git status</code></p>
<h3 id="heading-3-git-add">3. git add</h3>
<p><strong>To send files to the staging area:</strong></p>
<p><strong>For a single file:</strong></p>
<p><code>git add &lt;File Name&gt;</code></p>
<h3 id="heading-4-git-commit">4. git commit</h3>
<p><strong>To save the code:</strong></p>
<ul>
<li><p>Always do it with a message</p>
</li>
<li><p>The message should be clear</p>
</li>
</ul>
<p><code>git commit -m "add any message”</code></p>
<h3 id="heading-5-git-log">5. git log</h3>
<p>To view the history of all commits made so far.</p>
<p><code>Git log</code></p>
<p><strong>It shows:</strong></p>
<p>Commit ID , Author , Date , Message.</p>
<h3 id="heading-6-git-branch">6. git branch</h3>
<p>To view or create a branch.</p>
<p><strong>To view all branches:</strong></p>
<p><code>git branch</code></p>
<p><strong>To create a new branch:</strong></p>
<p><code>git branch feature-login</code></p>
<h3 id="heading-7-git-merge">7. git merge</h3>
<p>To merge a branch into the main branch:</p>
<p><code>git merge feature-login</code></p>
<h3 id="heading-8-git-remote">8. git remote</h3>
<p>To check the remote repository (GitHub):</p>
<p><code>git remote -v</code></p>
<h3 id="heading-9-git-push">9. git push</h3>
<p>To send code from the local system to GitHub:</p>
<p><code>git push origin main</code></p>
<h3 id="heading-10-git-pull">10. git pull</h3>
<p>To get the latest code from GitHub:</p>
<p><code>git pull origin main</code></p>
]]></content:encoded></item></channel></rss>