<?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[Huzaif's blog]]></title><description><![CDATA[Huzaif's blog]]></description><link>https://huzaif.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 20:13:37 GMT</lastBuildDate><atom:link href="https://huzaif.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Some Useful Git Commands you should Know 🚀]]></title><description><![CDATA[Git is very popular version controlling system almost used by every developer to manage their code efficiently and keep the track record of the commit in codebase by time. The place where we store the code could be Github, GitLab, BitBucket or AzureD...]]></description><link>https://huzaif.hashnode.dev/some-useful-git-commands-you-should-know</link><guid isPermaLink="true">https://huzaif.hashnode.dev/some-useful-git-commands-you-should-know</guid><category><![CDATA[Git]]></category><category><![CDATA[iwritecode]]></category><category><![CDATA[tools]]></category><dc:creator><![CDATA[Huzaif Quazi]]></dc:creator><pubDate>Sat, 23 Jul 2022 19:31:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/xrVDYZRGdw4/upload/v1658599160645/ILwyONs1z.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p>Git is very popular version controlling system almost used by every developer to manage their code efficiently and keep the track record of the commit in codebase by time. The place where we store the code could be Github, GitLab, BitBucket or AzureDevOps . No matter if you are beginner or experienced developer , these are the commands that every developer should know. So lets start.</p>
</blockquote>
<hr />
<h1 id="heading-git-commands">Git Commands</h1>
<p>1.
<code>git config [ options ]</code>
This command helps you set the username and email address to be used with your commits respectively.</p>
<pre><code>  git config <span class="hljs-operator">-</span><span class="hljs-operator">-</span>global user.<span class="hljs-built_in">name</span> <span class="hljs-string">"ZeffK"</span>
  config <span class="hljs-operator">-</span><span class="hljs-operator">-</span>global user.email <span class="hljs-string">"Zeff@dev.com"</span>
</code></pre><hr />
<p>2.
<code>git init [ repository name ]</code>
This command initializes a repository as git repository. To perform git operations you need to initialize the target repository as a git repository.</p>
<pre><code>git init <span class="hljs-operator">/</span>home<span class="hljs-operator">/</span>zeff<span class="hljs-operator">/</span>Documents<span class="hljs-operator">/</span>iwritecode
</code></pre><p>  The folder <code>iwritecode</code> will be initialized as a git repository here.
  Alternatively you can go into that repository and then initialize it by simply giving the command git init</p>
<hr />
<p>3.
<code>git clone [ URL ]</code>
This command is used to download an existing repository from a server by an existing URL.</p>
<pre><code>git <span class="hljs-keyword">clone</span> https:<span class="hljs-comment">//github.com/ZeffK/ReactLearning.git</span>
</code></pre><hr />
<p>4.
<code>git status</code>
This command is used to see the status of the working tree. It shows you the list of unstaged files and list of files that needs commit. If there is nothing do then it will simply show that the branch is clean.</p>
<pre><code><span class="hljs-attribute">git</span> status
</code></pre><hr />
<p>5.
<code>git add [File Name]</code>
This command puts the desired file to the staging area if any changes are made in that file.</p>
<pre><code>git <span class="hljs-keyword">add</span> app.js
</code></pre><hr />
<p>6.
<code>git commit [options]</code>
This command records changes to the git repository by saving a log message together with a commit id of the changes made.</p>
<pre><code>git <span class="hljs-keyword">commit</span> -m "Write your message here"
</code></pre><hr />
<p>7.
<code>git push [ options ] [ variable name ] [ branch ]</code></p>
<p>This command is used to push the contents of your local repository to the added remote repository. This sends the committed changes of your master branch to the added remote repository.</p>
<pre><code>git <span class="hljs-keyword">push</span> -u origin main
</code></pre><p>Note- <code>-u</code> denotes upstream i.e to keep track of file with origin</p>
<hr />
<p>8.
<code>git pull</code>
This command is used to fetch and integrate the contents of the remote repository to your local repository.</p>
<pre><code><span class="hljs-attribute">git</span> pull
</code></pre><hr />
<p>9.
<code>git checkout [ branch name ]</code>
This command is used to move from one branch to another</p>
<pre><code><span class="hljs-attribute">git</span> checkout dev
</code></pre><hr />
<p>10.
<code>git branch [ options ] [ branch name ]</code>
This is used to create a new branch from existing branch and to switch to newly created branch</p>
<pre><code><span class="hljs-attribute">git</span> branch -b newbranch
</code></pre><hr />
<blockquote>
<p><em>For all git commands you can refer to <a target="_blank" href="https://git-scm.com/docs/git">Git Docs</a></em></p>
</blockquote>
<h3 id="heading-follow-me-on-instagramhttpsinstagramcomqazi958">Follow me on <a target="_blank" href="https://instagram.com/qazi_958">Instagram</a></h3>
]]></content:encoded></item></channel></rss>