# filter-branch ignoring gitattributes?

2 messages from 2012-02-03 to 2012-02-08. Participants: norbert.nemec.
Thread: https://gitlist.dev/t/29534

## norbert.nemec, 2012-02-03 12:55

Subject: filter-branch ignoring gitattributes?
Message-ID: <jgglh9$mrv$1@dough.gmane.org>
URL: https://gitlist.dev/e/jgglh9%24mrv%241%40dough.gmane.org

```
Hi there,

it seems that 'git filter-branch' ignores the setting in
.git/info/attributes - is that correct?

Does .gitattributes work reliably?

Specifically, I tried

	git filter-branch \
		--tree-filter 'echo "* text=auto" > .gitattributes' \
             	--tag-name-filter cat
		--prune-empty -- --all

It seems to work, but I am not sure whether I missed anything.

Greetings,
Norbert

```

## norbert.nemec, 2012-02-08 08:23

Subject: Re: filter-branch ignoring gitattributes?
Message-ID: <jgtbdh$ahf$1@dough.gmane.org>
URL: https://gitlist.dev/e/jgtbdh%24ahf%241%40dough.gmane.org
In-Reply-To: <jgglh9$mrv$1@dough.gmane.org>

```
Meanwhile, I can answer my own question:

The "text" attribute works similar to a filter.
As with filters in general, it is only applied when git detects a 
modification in the file. A file change is detected by the file 
modification time on disc. To reread all files from disk and re-apply 
the filters to all of them, you would typically delete the .git/index 
file. In filter-branch, this is not possible, so instead you have to 
"touch" all files in the --tree-filter command.


Am 03.02.12 13:55, schrieb norbert.nemec:
> Hi there,
>
> it seems that 'git filter-branch' ignores the setting in
> .git/info/attributes - is that correct?
>
> Does .gitattributes work reliably?
>
> Specifically, I tried
>
> git filter-branch \
> --tree-filter 'echo "* text=auto" > .gitattributes' \
> --tag-name-filter cat
> --prune-empty -- --all
>
> It seems to work, but I am not sure whether I missed anything.
>
> Greetings,
> Norbert
>

```
