Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

gitignore

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.

Update

.gitignore file content:

calc/
0_BSc_Alvarez/
calc/0_Test/
documentation/Tutorial_Fluent/
literature/
thunderbird/
**/.idea/
.zim
**/ND800_*
**/*.cas
**/*.dat
**/*.cdat
**/*.uns
**/*.msh
**/*.bak

git version is 1.7.1

like image 617
Bastian Avatar asked Nov 19 '16 09:11

Bastian


1 Answers

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
like image 167
Roman Avatar answered Nov 14 '22 22:11

Roman