<?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: Basics & Commands]]></title><description><![CDATA[Git for Beginners: Basics & Commands]]></description><link>https://git-for-beginners-basics-and-commands.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 08:36:13 GMT</lastBuildDate><atom:link href="https://git-for-beginners-basics-and-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 & Commands]]></title><description><![CDATA[Learn Git basics, core concepts, and essential Git commands with simple explanations and beginner-friendly examples.]]></description><link>https://git-for-beginners-basics-and-commands.hashnode.dev/git-for-beginners-basics-and-commands</link><guid isPermaLink="true">https://git-for-beginners-basics-and-commands.hashnode.dev/git-for-beginners-basics-and-commands</guid><category><![CDATA[Git]]></category><category><![CDATA[version control]]></category><category><![CDATA[#Gitbasics]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[ZAHID QURESHI]]></dc:creator><pubDate>Sat, 03 Jan 2026 08:29:12 GMT</pubDate><content:encoded><![CDATA[<h3 id="heading-introduction">Introduction</h3>
<p>Git is one of the most important tools for the developers. It helps us save code changes, track history and works with teams easily.</p>
<h2 id="heading-what-is-git">What is Git ?</h2>
<p>Git is a distributed version control system.</p>
<p>This means :</p>
<ol>
<li><p>Git keeps a history of our code.</p>
</li>
<li><p>Every developer has a full copy of the project.</p>
</li>
<li><p>We can switch to any older versions anytime.</p>
</li>
</ol>
<p>Therefore in easy words, its like a time machine of our code.</p>
<h2 id="heading-why-git-is-used">Why Git is Used ?</h2>
<p>Before Git, developers used:</p>
<p>pendrive, emails, files like project_final_v3.zip</p>
<p>This has caused many problems:</p>
<p>code gets lost, confusion between versions and team member over wrote each others work’s</p>
<h3 id="heading-git-solves-this-problems-by">Git solves this problems by:</h3>
<ol>
<li><p>Tracking every change</p>
</li>
<li><p>Saving history safely</p>
</li>
<li><p>Allowing team work</p>
</li>
<li><p>Making rollback easy</p>
</li>
</ol>
<h2 id="heading-git-basics-and-terminologies">Git Basics and Terminologies</h2>
<ol>
<li><h3 id="heading-repositoryrepo">Repository(Repo)</h3>
<p> A Repository is a folder managed by Git.</p>
<p> It contains :<br /> - Projects files</p>
<p> - Git History</p>
<p> Example: <code>git init</code></p>
</li>
<li><h3 id="heading-working-directory">Working Directory</h3>
<p> This is where you write and edit files.</p>
</li>
<li><h3 id="heading-staging-area">Staging Area</h3>
<p> The Staging are is where you prepare files before saving them permanently.</p>
<p> Command : <code>git add filename</code></p>
</li>
<li><h3 id="heading-commit">Commit</h3>
<p> A commit is a saved snapshot of your code.</p>
<p> Command: <code>git commit -m “Initial commit“</code></p>
</li>
<li><h3 id="heading-branch">Branch</h3>
<p> A branch allows you to work on features without affecting main code.</p>
</li>
<li><h3 id="heading-head">HEAD</h3>
<p> HEAD points th the current commit you are working on.</p>
</li>
</ol>
<h2 id="heading-common-git-commandswith-simple-explanation">Common Git Commands(With Simple Explanation)</h2>
<ul>
<li><p><code>git init</code> - Creates a new git repository</p>
</li>
<li><p><code>git status</code> - Show current states of files</p>
</li>
<li><p><code>git add .</code> - Moving files to staging area</p>
</li>
<li><p><code>git commit -m “homepage added“</code> - Saving changes permantently</p>
</li>
<li><p><code>git log</code> - Show commit history</p>
</li>
</ul>
<h2 id="heading-basic-developer-workflow-using-git">Basic Developer workflow using Git</h2>
<ol>
<li><p>Create Project folder</p>
</li>
<li><p>Run <code>git init</code></p>
</li>
<li><p>Create or edit files</p>
</li>
<li><p>Check status using git</p>
</li>
<li><p>Add files using <code>git add .</code></p>
</li>
<li><p>Commit changes using <code>git commit</code></p>
</li>
<li><p>View history using <code>git log</code></p>
</li>
</ol>
<h2 id="heading-diagram-workflow">Diagram Workflow</h2>
<p>Working directory</p>
<p>↓</p>
<p>Staging Area</p>
<p>↓</p>
<p>Repository</p>
<p><strong>First, changes are made in the working directory. Then files are added to the staging area.</strong></p>
<p><strong>Finally, changes are saved permanently in the repository.</strong></p>
<h2 id="heading-commit-history-flow">Commit History Flow</h2>
<p>Commit 1 → Commit 2 → Commit 3</p>
<h2 id="heading-local-repository-structure">Local Repository Structure</h2>
<h3 id="heading-project-folder">project-folder</h3>
<p><strong>│── .git</strong></p>
<p><strong>│── index.html</strong></p>
<p><strong>│── style.css</strong></p>
]]></content:encoded></item></channel></rss>