Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitignore not ignoring .cs.meta files

All I want is for for git to ignore files that end in .cs.meta.
My .gitignore file includes just this:

# ignore all .cs.meta files
*.cs.meta

How can ignore only files that end in .cs.meta?

like image 640
user3312266 Avatar asked Jan 31 '26 21:01

user3312266


2 Answers

To ignore ignore all .cs.meta files you just need to add

*.cs.meta

in your .gitignore file.

You did it! Maybe is not working because you added them to .gitignore after their repository addition. You now need to remove them from the git repository:

git rm file.cs.meta

and then commit again.

like image 141
sensorario Avatar answered Feb 03 '26 11:02

sensorario


To make sure any of your ignored file is not present in the index:

git ls-files --ignored --exclude-standard -z|xargs -0 git rm --cached
git commit -am "Remove ignored files"

Then you can check if your files are ignored with:

git check-ignore -v -- /path/to/a/file.cs.meta

It should display your ignore rule now.

like image 39
VonC Avatar answered Feb 03 '26 12:02

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!