# How to exclude some files when using git-archive?

3 messages from 2009-01-16 to 2009-01-16. Participants: Ping Yin, Junio C Hamano.
Thread: https://gitlist.dev/t/17198

## Ping Yin, 2009-01-16 02:40

Subject: How to exclude some files when using git-archive?
Message-ID: <46dff0320901151840l18257501x62a3fa1fe9701dc@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320901151840l18257501x62a3fa1fe9701dc%40mail.gmail.com

```
I want to exclude .gitignore from the archive, but hasn't find a easy way

Ping Yin

```

## Junio C Hamano, 2009-01-16 02:44

Subject: Re: How to exclude some files when using git-archive?
Message-ID: <7v4p00otpb.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v4p00otpb.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <46dff0320901151840l18257501x62a3fa1fe9701dc@mail.gmail.com>

```
Ping Yin <pkufranky@gmail.com> writes:

> I want to exclude .gitignore from the archive, but hasn't find a easy way
>
> Ping Yin

"man gitattributes", then look for export-ignore?

```

## Ping Yin, 2009-01-16 05:26

Subject: Re: How to exclude some files when using git-archive?
Message-ID: <46dff0320901152126u2bb9ff55qce9a22c69276bc6a@mail.gmail.com>
URL: https://gitlist.dev/e/46dff0320901152126u2bb9ff55qce9a22c69276bc6a%40mail.gmail.com
In-Reply-To: <7v4p00otpb.fsf@gitster.siamese.dyndns.org>

```
On Fri, Jan 16, 2009 at 10:44 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Ping Yin <pkufranky@gmail.com> writes:
>
>> I want to exclude .gitignore from the archive, but hasn't find a easy way
>>
>> Ping Yin
>
> "man gitattributes", then look for export-ignore?
>
>

Thanks. That's exactly what i want.

One question: It seems the .gitattributes doesn't take effect when
using following command

GIT_DIR=A/.git git archive HEAD > A.tar

where the files with attribute export-ignore are still exported.

Instead, i have to run

cd A && git archive HEAD > A.tar

Ping Yin

```
