Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

files in .git/info/exclude not work

Tags:

git

github

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.

like image 420
John Fadria Avatar asked Nov 12 '14 08:11

John Fadria


2 Answers

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.

like image 107
Lukáš Koten Avatar answered Oct 03 '22 22:10

Lukáš Koten


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.

like image 27
VonC Avatar answered Oct 03 '22 22:10

VonC