Problem: Not possible to setup exclusion with /**/ mask and names with "dot" Directory structure: conf/ conf/server.conf conf/server.conf.default conf/etc/ conf/etc/php.ini conf/etc/php.ini.default conf/etc/init.d/ conf/etc/init.d/fail2ban conf/etc/init.d/fail2ban.default controls/ controls/on_server_start Require: 1. track all files in all directories except conf/ 2. inside conf/ directory require track only *.default files My tries of .gitignore: 1. /conf/**/* !/conf/**/*.default result: git check-ignore -v --no-index conf/etc/init.d/fail2ban.default .gitignore:1:/conf/**/* conf/etc/init.d/fail2ban.default 2. /conf/**/*. !/conf/**/*.default result: git check-ignore -v --no-index conf/etc/init.d/fail2ban.default .gitignore:2:!/conf/**/*.default conf/etc/init.d/fail2ban.default but git check-ignore -v --no-index conf/server.conf (empty) Tested on Git v2.18.0(linux) and v2.20.1(windows) -- Maxim