0

I've locally changed my .vscode/settings.json (added some user vocabulary). I don't want to merge this to the shared repo, but it's annoying me because git keeps tracking it.

I don't want to edit .gitignore because I would also have to make the push to the shared repo.

I tried using the --assume-unchanged flag but it's not working:

git update-index --assume-unchanged .vscode/ returns: Ignoring path .vscode/.

But when I log git status afterwards, I still get

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    .vscode/

If I try with git update-index --assume-unchanged .vscode/settings.json, I get fatal: Unable to mark file .vscode/settings.json.

Any ideas on how to solve this?

Suki
  • 177
  • 3
  • 12
  • 1
    add the settings.json to gitignore? that way it will ignore it unless you want it tracked again which is when you delete it from gitignore again – tHeSiD Feb 17 '22 at 13:27
  • hi, I don't want to add it to the gitignore - see my question again pls. I don't want to commit the gitignore either. :) – Suki Feb 17 '22 at 13:32
  • 1
    oh my bad, have you checked this ? https://stackoverflow.com/questions/653454/how-do-you-make-git-ignore-files-without-using-gitignore – tHeSiD Feb 17 '22 at 13:34
  • Nice!! This worked: adding to `.git/info/exclude` .Thanks :) – Suki Feb 17 '22 at 13:44

0 Answers0