<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shahrkh Sidd</title>
    <description>The latest articles on DEV Community by Shahrkh Sidd (@shani).</description>
    <link>https://dev.to/shani</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3392844%2Fee02f29e-23d4-4170-b8aa-a089db173305.png</url>
      <title>DEV Community: Shahrkh Sidd</title>
      <link>https://dev.to/shani</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shani"/>
    <language>en</language>
    <item>
      <title>🚀 7 Git Tricks You Probably Didn't Know Existed</title>
      <dc:creator>Shahrkh Sidd</dc:creator>
      <pubDate>Mon, 28 Jul 2025 04:10:12 +0000</pubDate>
      <link>https://dev.to/shani/7-git-tricks-you-probably-didnt-know-existed-4h5n</link>
      <guid>https://dev.to/shani/7-git-tricks-you-probably-didnt-know-existed-4h5n</guid>
      <description>&lt;p&gt;We all use git daily, but it has a ton of powerful (and lesser-known) features that can make your life easier. Here are some Git tricks that go beyond git status and git push.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Undo Your Last Commit (But Keep Changes)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;git reset --soft HEAD~1&lt;/p&gt;

&lt;p&gt;This undoes your last commit but keeps your changes staged. Super handy when you realize your commit message was wrong or you forgot to include a file.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Undo Last Commit (keep changes)&lt;/p&gt;

&lt;p&gt;📘 &lt;a href="https://thedelightrecipes.blogspot.com/" rel="noopener noreferrer"&gt;Git Reset Explained&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Remove a File from History (Without Nuking Your Repo)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;git filter-branch --force --index-filter \&lt;br&gt;
"git rm --cached --ignore-unmatch SECRET_FILE" \&lt;br&gt;
--prune-empty --tag-name-filter cat -- --all&lt;/p&gt;

&lt;p&gt;Oops! Did you commit an API key? This will remove the file from all commits.&lt;br&gt;
(Use with caution — history rewrite ahead!)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Remove a File from Git History&lt;/p&gt;

&lt;p&gt;📘 Removing Sensitive Data from Git History&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;See Who Changed a Specific Line&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;git blame FILE&lt;/p&gt;

&lt;p&gt;Find out who changed which line of code and when. Useful for tracking down bugs or understanding legacy logic.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Git Blame&lt;/p&gt;

&lt;p&gt;📘 Git Blame Documentation&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Stash Only Certain Files&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;git stash push -m "my partial stash" myfile.js&lt;/p&gt;

&lt;p&gt;No need to stash everything. This command lets you stash just one or a few files.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Stash Specific Files&lt;/p&gt;

&lt;p&gt;📘 &lt;a href="https://thedelightrecipes.blogspot.com/" rel="noopener noreferrer"&gt;Advanced Git Stash Usage&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Show Changes in a File You Staged&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;git diff --cached&lt;/p&gt;

&lt;p&gt;Check what's going to be committed — super helpful before running git commit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Show Staged Changes&lt;/p&gt;

&lt;p&gt;📘 &lt;a href="https://thedelightrecipes.blogspot.com/" rel="noopener noreferrer"&gt;git diff vs git diff --cached&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Remove Local Branches That Are Already Merged&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;git branch --merged | grep -v '*' | xargs git branch -d&lt;/p&gt;

&lt;p&gt;Clean up your local repo by deleting all fully merged branches.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Remove Merged Branches&lt;/p&gt;

&lt;p&gt;📘 &lt;a href="https://thedelightrecipes.blogspot.com/" rel="noopener noreferrer"&gt;Cleaning Up Local Git Branches&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;See Your Commit History Like a Tree&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;git log --oneline --graph --all&lt;/p&gt;

&lt;p&gt;Visualize your commit history across branches. Great for understanding project flow.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;View Commit Tree&lt;/p&gt;

&lt;p&gt;📘 &lt;a href="https://thedelightrecipes.blogspot.com/" rel="noopener noreferrer"&gt;Visualize Git Log Like a Pro&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💬 Got Any Favorites?&lt;/p&gt;

&lt;p&gt;Which of these did you not know? Or do you have a secret Git trick of your own?&lt;br&gt;
Drop it below — let’s learn from each other! 🙌&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>git</category>
      <category>devbugsmash</category>
      <category>devtips</category>
    </item>
  </channel>
</rss>
