Search code examples
gitgithubgitignore

.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?


Solution

  • 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.