John Fadria
John Fadria

Reputation: 1945

files in .git/info/exclude not work

I've put two files in .git/info/exclude but I can still see them with a git st

They are a config files, and I don't want to commit more. I put them there because with --assume-unchanged and --skip-worktree I can not checkout to another branch.

Upvotes: 10

Views: 6978

Answers (2)

Lukáš Koten
Lukáš Koten

Reputation: 1253

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

Upvotes: 16

VonC
VonC

Reputation: 1323145

I can still see them with a git st

That means they are still versioned: you need to remove them from the index first:

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

Then the git status would ignore those files.

Upvotes: 5

Related Questions