# Git attributes are read from head branch instead of given branch when using git archive

2 messages from 2017-03-09 to 2017-03-09. Participants: Aalex Gabi, Brandon Williams.
Thread: https://gitlist.dev/t/45333

## Aalex Gabi, 2017-03-09 21:02

Subject: Git attributes are read from head branch instead of given branch when using git archive
Message-ID: <CABRdPwCA6UR0kkZ2T8W4OYZ36oBwF9hw+SpJHXDE15CHyFiA8A@mail.gmail.com>
URL: https://gitlist.dev/e/CABRdPwCA6UR0kkZ2T8W4OYZ36oBwF9hw%2BSpJHXDE15CHyFiA8A%40mail.gmail.com

```
Hello,

git archive --remote="URL" branchname > branchname.tar.gz is not
reading .gitattributes file from the given branch but from HEAD. More
specifically export-ignore lines in the target branch are ignored.

The remote is using git protocol and it's served by Gitlab. I use git
version 2.11.0.

Is this a git issue? In that case is this a bug or a known limitation?

Best regards,
Aalex Gabi

```

## Brandon Williams, 2017-03-09 21:45

Subject: Re: Git attributes are read from head branch instead of given branch when using git archive
Message-ID: <20170309214545.GA52558@google.com>
URL: https://gitlist.dev/e/20170309214545.GA52558%40google.com
In-Reply-To: <CABRdPwCA6UR0kkZ2T8W4OYZ36oBwF9hw+SpJHXDE15CHyFiA8A@mail.gmail.com>

```
On 03/09, Aalex Gabi wrote:
> Hello,
> 
> git archive --remote="URL" branchname > branchname.tar.gz is not
> reading .gitattributes file from the given branch but from HEAD. More
> specifically export-ignore lines in the target branch are ignored.
> 
> The remote is using git protocol and it's served by Gitlab. I use git
> version 2.11.0.
> 
> Is this a git issue? In that case is this a bug or a known limitation?
> 
> Best regards,
> Aalex Gabi

Could you provide a little more context with the problem you are having?
When you say HEAD are you referring to the server's HEAD?

When testing this locally (with a relative URL) I can't seem to
reproduce what you are describing.  If you could provide a way to
reproduce this I would be able to more easily diagnose the problem.

-- 
Brandon Williams

```
