Bastian Bastian - 20 days ago 5
Git Question

.gitignore does not work for **/*.xyz

My git project contains .cas files that I do not want to be pushed to the repository. I thus added the line

**/*.cas


to my
.gitignore
file but
.cas
files would still appear in
git status
.
After reading through numerous other posts I checked for the
.gitignore
entries to not have trailing white spaces and that they do have unix line change specifiers.

I then ran the following commands as advised here:
.gitignore does not work

git rm -r --cached .
git add .


but in vain!
git status
still reports e.g.

new file: calc/2_preliminary/1_CFD/7_Calc_Fluent/03_stationary_vof_stationary/mesh_04/run_10000.cas


Any ideas? I would really appreciate it.

Answer

You said in comments that you use git v1.7.1. Old git version is the problem. **/ pattern was added only in 1.8.2, so your git just doesn't understand it. Besides, you don't really need the **/ part, you should use just

*.cas