Files in .git / info / exclude do not work

I put two files in .git/info/exclude, but I still see them withgit st

These are configuration files, and I don't want to commit anymore. I put them there because with --assume-unchangedand --skip-worktreeI cannot check another branch.

+4
source share
2 answers

I still see them with git st

This means that they are still being versioned: first you need to remove them from the index:

git rm --cached -- yourConfigFile
git add .
git commit -m "Record deletion of yourConfigfile"

Then it git statuswill ignore these files.

+2
source

If a file that is already in the GIT repository is excluded with .git/info/exclude, you need to run git update-index --assume-unchanged <path-of-the-excluded-file>it to ignore further changes.

+1
source

All Articles