# Ignoring Local Changes in Git
Sometimes you want to change a file locally—like .vscode/settings.json, a .env file, or other config—but don’t want Git to track those changes. Here's how you can do that.
Sometimes you want to change a file locally—like .vscode/settings.json, a .env file, or other config—but don’t want Git to track those changes. Here's how you can do that.
If the file is not tracked (i.e., not in the Git index), you can add it to .git/info/exclude. This works just like a .gitignore file, but only affects your local clone.
.vscode/settings.json .env
This is ideal for ignoring files you never want tracked in your local repo, without touching the shared .gitignore.
If the file is already tracked (committed in the repo), you can't use .gitignore. Instead, run:
git update-index --assume-unchanged <path-to-file>
This tells Git to ignore local changes to that file — it won't show up in git status or get included in commits.
To reverse it:
git update-index --no-assume-unchanged <path-to-file>
To see which files are being hidden this way:
git ls-files -v | grep '^h'
If someone else updates the file in the repo, git pull may fail due to conflicts. In that case: