git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* .gitignore negates by mask problem
@ 2019-03-15 16:27 Maxim some
  0 siblings, 0 replies; only message in thread
From: Maxim some @ 2019-03-15 16:27 UTC (permalink / raw)
  To: git@vger.kernel.org

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-15 16:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-15 16:27 .gitignore negates by mask problem Maxim some

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).