<?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[Untitled Publication]]></title><description><![CDATA[Untitled Publication]]></description><link>https://dhruvtrivedi.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 20:04:12 GMT</lastBuildDate><atom:link href="https://dhruvtrivedi.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Little bit Git...]]></title><description><![CDATA[Getting started head on...
git log
Suppose you are working on some project, the conflict error occured again and again when you were trying to push. So, you decided to use rebase and move ahead with the problem but you needed to git see the commit hi...]]></description><link>https://dhruvtrivedi.hashnode.dev/little-bit-git</link><guid isPermaLink="true">https://dhruvtrivedi.hashnode.dev/little-bit-git</guid><category><![CDATA[Git]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[Dhruv trivedi]]></dc:creator><pubDate>Tue, 28 Nov 2023 14:01:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1701179713930/a07ac8ef-ebd7-4287-ad2d-9641fd331552.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Getting started head on...</p>
<h2 id="heading-git-log">git log</h2>
<p>Suppose you are working on some project, the conflict error occured again and again when you were trying to push. So, you decided to use <code>rebase</code> and move ahead with the problem but you needed to git see the commit history before you could use <code>git rebase</code> so what command did you need to use?</p>
<pre><code class="lang-bash">git <span class="hljs-built_in">log</span> &lt;branch-to-rebase-onto&gt;..HEAD
</code></pre>
<p>where <code>&lt;branch-to-rebase-onto&gt;</code> is replaced with the branch where I have to rebase it onto(generally it's <code>origin/master</code>)</p>
<h2 id="heading-git-stash">git stash</h2>
<p>I was trying to setup an environment for some open source project, which needed installation of <strong>Vagrant</strong>. While doing the setup of the environment, I went through several Errors!<br />I solved some with the help of my helpful brother and some on my own but then in the end, I figured out that some Changes that I made in my configuration file for Vagrant were not suitable for pushing to the origin of the main repository for that open source project.</p>
<p><em>In Short, there were some Changes specific for my own system(not suitable for a public repository)</em></p>
<p>Now I needed to add my changes to git commit without adding that configuration file, which command did I use to ignore that particular file?</p>
<pre><code class="lang-bash">git stash
</code></pre>
<p>If you want to reapply the changes back to the working directory, use this command👇</p>
<pre><code class="lang-bash">git stash pop
</code></pre>
<h2 id="heading-stash-apply">Stash Apply</h2>
<p>There was a time when I wanted to restore some previously stashed work to a new Branch using git, How did I do it?</p>
<p>The answer is this👇</p>
<ul>
<li><strong>Create a New Branch:</strong></li>
</ul>
<pre><code class="lang-plaintext">git checkout -b new_branch_name
</code></pre>
<ul>
<li><strong>Apply Stashed Changes:</strong></li>
</ul>
<pre><code class="lang-plaintext">git stash apply
</code></pre>
<p>or</p>
<p>I can use this👇</p>
<pre><code class="lang-plaintext">git stash branch new_branch_name
</code></pre>
<p>where <code>branch</code> and <code>new_branch_name</code> are the branches from which you are taking stashed changes from and the branch you are pushing it to respectively</p>
<h2 id="heading-tags">Tags:</h2>
<p>Tags are necessary to mark specific points the history of the commits!<br />Releases are one important example</p>
<p>To push tags to a remote repository:</p>
<pre><code class="lang-plaintext">git push origin &lt;tagname&gt;
</code></pre>
<p>replace <code>tagname</code> with whatever tag you want to paste</p>
<h2 id="heading-git-diff">git diff:</h2>
<p>To review the changes that are currently staged (in the index) before committing them, use this👇</p>
<pre><code class="lang-plaintext">git diff --cached
</code></pre>
<p>Thanks 🤟 for reading the article!</p>
]]></content:encoded></item></channel></rss>