Re: Query about gitignore
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Feb 7, 2024, 05:43 UTC
- Message-ID
- <ZcMYiOxBA-N0NwWT@tanuki>
- In-Reply-To
- <B7F364DA-27E7-4BDC-93EE-32E6430B6ACE@gmail.com>
Hi Divyaditya,
On Wed, Feb 07, 2024 at 01:56:34AM +0530, Divyaditya Singh wrote:
Show 7 quoted lines
> Hello there, > > I hope you are having a wonderful day. > > I apologize if this is inappropriate but I wanted to ask is there a > way that I can make my .gitignore such that it ignores the entire > parent directory of a matching file.
Not inappropriate at all!
Rephrasing what you say, you basically want to ignore "dir/" if and only if "dir/a" exists and matches a specific pattern in your gitignore, right? If so, this is not something that you can currently achieve with gitignores.
Would you mind maybe explaining your particular usecase a bit more? This _could_ help to find a different solution for you. But even if there is none it might motivate others to think about possible ways to implement this in Git if there is interest.
Patrick