Rich
Rich

Reputation: 6561

Exclude File from Uncommitted Changes

I have a config.debug.json file that I update frequently based on which server I'm pointing to. Is there anyway to exclude this file from Uncommitted changes? In sourcetree and vs code it shows up as an uncommitted change, but I never want to commit the change.

Upvotes: 0

Views: 123

Answers (1)

Matt Bierner
Matt Bierner

Reputation: 65223

Try adding config.debug.json to your .gitignore. This will exclude the file from source control, which should prevent it from showing up in the changes section for vscode and sourcetree

Update

If you've already added the file at some, you first need to untrack it by running:

git rm --cached config.debug.json

This will leave the file on your system but stop tracking it

Upvotes: 1

Related Questions