<?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: Jay Patel</title>
    <description>The latest articles on DEV Community by Jay Patel (@jaipatel).</description>
    <link>https://dev.to/jaipatel</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%2F1076150%2F804ccfc6-c1b5-49c1-8c1f-607efe7ad278.png</url>
      <title>DEV Community: Jay Patel</title>
      <link>https://dev.to/jaipatel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jaipatel"/>
    <language>en</language>
    <item>
      <title>Ignore a File in Git Without Editing .gitignore</title>
      <dc:creator>Jay Patel</dc:creator>
      <pubDate>Mon, 15 Sep 2025 03:30:00 +0000</pubDate>
      <link>https://dev.to/jaipatel/ignore-a-file-in-git-without-editing-gitignore-5366</link>
      <guid>https://dev.to/jaipatel/ignore-a-file-in-git-without-editing-gitignore-5366</guid>
      <description>&lt;p&gt;I work across multiple repositories. When you're juggling that many repos, it's easy to lose track of which one you're in. I kept finding myself squinting at the repo name in VS Code to make sure I wasn't about to make changes in the wrong project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6c76uuo0tswqspbxpuic.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6c76uuo0tswqspbxpuic.png" alt="Worried" width="800" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's when I discovered Peacock, a VS Code extension that lets you change the editor color based on the project. A tiny visual cue, but a huge time-saver when you're context-switching all day.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;The problem? One of our repos doesn't ignore the .vscode/settings.json file. So every time I tweaked Peacock's colors, Git would flag .vscode/settings.json as modified. Before committing, I had to manually stash or reset those changes so I wouldn't accidentally push them upstream.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmc10uvep41tr7j5qwh5q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmc10uvep41tr7j5qwh5q.png" alt="git status" width="519" height="80"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I didn't want to touch .gitignore since teammates rely on committing shared project settings. What I needed was a way for Git to quietly ignore my tweaks without disrupting the repo for everyone else.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Command That Saved My Sanity
&lt;/h2&gt;

&lt;p&gt;After some digging, I learned about a neat trick:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Tell Git to ignore local changes to this file
git update-index --skip-worktree .vscode/settings.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From that point on, Git acted like the file was untouched, even if I completely changed the colors inside it. When I rangit status, nothing showed up. No more accidental commits, no more manual cleanup before pushing.&lt;/p&gt;

&lt;p&gt;And if I ever need Git to notice changes again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git update-index --no-skip-worktree .vscode/settings.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When to Use It&lt;br&gt;
Use &lt;code&gt;--skip-worktree&lt;/code&gt; When:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The repo includes files that should be tracked, but your local edits aren't relevant to anyone else (like editor configs, test configs, or local scripts).&lt;/li&gt;
&lt;li&gt;You want to keep your workflow smooth without constantly cleaning up changes before commits.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Avoid it when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need to collaborate on that file with your team.&lt;/li&gt;
&lt;li&gt;Forgetting about the "skip" could cause important updates to be missed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Final Thoughts&lt;br&gt;
Peacock solved my repo-switching confusion. And git update-index --skip-worktree solved the annoying "settings file keeps showing up in git status" problem. Together, they've made my day-to-day dev flow smoother.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foyp340h7r2iw5fzswk5q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foyp340h7r2iw5fzswk5q.png" alt="Happy" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sometimes it's not about the big tools or frameworks - it's the little tweaks that save you the most brain cycles.&lt;/p&gt;

</description>
      <category>git</category>
      <category>vscode</category>
      <category>tooling</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
