# How to include just some subdirectory excluding all envelop tree

3 messages from 2016-03-07 to 2016-03-07. Participants: Olga Pshenichnikova, Kevin Daudt.
Thread: https://gitlist.dev/t/41638

## Olga Pshenichnikova, 2016-03-07 19:01

Subject: How to include just some subdirectory excluding all envelop tree
Message-ID: <56DDD020.2050101@ip-5.ru>
URL: https://gitlist.dev/e/56DDD020.2050101%40ip-5.ru

```
I have some tree structure:

/a
/a/a
/a/b
..
/a/z
/b
.. (thousands of folders)
/z

How can I control just /a/a folder?
What exclude file should be?

The way we use now is:

/a/*
/b/
.. (thousands of folders)
/z/
!/a/a

But it is very not nice looking and hard for maintenance...

```

## Kevin Daudt, 2016-03-07 21:06

Subject: Re: How to include just some subdirectory excluding all envelop tree
Message-ID: <20160307210608.GA29312@ikke.info>
URL: https://gitlist.dev/e/20160307210608.GA29312%40ikke.info
In-Reply-To: <56DDD020.2050101@ip-5.ru>

```
On Mon, Mar 07, 2016 at 10:01:52PM +0300, Olga Pshenichnikova wrote:
> I have some tree structure:
> 
> /a
> /a/a
> /a/b
> ..
> /a/z
> /b
> .. (thousands of folders)
> /z
> 
> How can I control just /a/a folder?
> What exclude file should be?
> 
> The way we use now is:
> 
> /a/*
> /b/
> .. (thousands of folders)
> /z/
> !/a/a
> 
> But it is very not nice looking and hard for maintenance...

Don't know your usecase, but isn't it easier to just create the repository
in /a/a? Then you won't have to exlude anything.

If you must, you can just use something like:

 *
 !/a
 /a/*
 !/a/a

```

## Olga Pshenichnikova, 2016-03-07 21:14

Subject: Re: How to include just some subdirectory excluding all envelop tree
Message-ID: <56DDEF1F.7040604@ip-5.ru>
URL: https://gitlist.dev/e/56DDEF1F.7040604%40ip-5.ru
In-Reply-To: <20160307210608.GA29312@ikke.info>

```
Thank you very much!
The exclamation mark solves my problem.
I can not create repository inside /a, because I need control /b also )

On 03/08/2016 12:06 AM, Kevin Daudt wrote:
> On Mon, Mar 07, 2016 at 10:01:52PM +0300, Olga Pshenichnikova wrote:
>> I have some tree structure:
>>
>> /a
>> /a/a
>> /a/b
>> ..
>> /a/z
>> /b
>> .. (thousands of folders)
>> /z
>>
>> How can I control just /a/a folder?
>> What exclude file should be?
>>
>> The way we use now is:
>>
>> /a/*
>> /b/
>> .. (thousands of folders)
>> /z/
>> !/a/a
>>
>> But it is very not nice looking and hard for maintenance...
> Don't know your usecase, but isn't it easier to just create the repository
> in /a/a? Then you won't have to exlude anything.
>
> If you must, you can just use something like:
>
>   *
>   !/a
>   /a/*
>   !/a/a

```
