git/list[1] front-page[2] threads[3] people[4] search[5] about
 

.gitignore negates by mask problem

From
MSMaxim some <sailormax@live.com>
Date
Mar 15, 2019, 16:27 UTC
Message-ID
<AM4PR08MB12333C0A3AC2E20BE74BD273DD440@AM4PR08MB1233.eurprd08.prod.outlook.com>

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

Message 1 of 1 in “.gitignore negates by mask problem”
  1. Maxim someMar 15, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.