I have this file hierarchy in my project:
assets
--script.js
--a.html
--admin
--carousel.js
--documentation.html
I want to add rules in .gitignore so that all files inside assets gets ignored except js files. I tried following in .gitignore that only considers script.js from first level:
assets
!assets/*.js
and then tried this which too only considers script.js :
assets
!assets/**/*.js
Other patterns like !assets//.js or !assets/**.js does not works. I want to consider all javascript files in all levels to consider as untracked.
I am trying this with Git version 2.1.0 .