git/list[1] front-page[2] threads[3] people[4] search[5] about
 

.gitattributes and defaulting to binary

From
MVMatthieu Vachon <matthieu.o.vachon@gmail.com>
Date
Sep 16, 2013, 21:35 UTC
Message-ID
<CAOTvmonjWtUM42ATpEu+s6GVcpTO10BT0izXVB_aqK2npgRfWQ@mail.gmail.com>
Hi all,

I would like to craft my `.gitattributes` in a way that all files expect those specified in it are treated as binary from a line-ending normalization point of view (and diff viewing).

But I was not able to achieve it right now. When having this in my `.gitattributes`, git treats all files as binary, even the one explicitly specified like `*.txt`:

    *.txt text
    * binary
I tried with:
    *.txt text
    * -text

And it does not seem to work correctly neither because then, my `test.txt` file is not having correct line ending when setting `core.eol` to `crlf` (or using `eol=crlf` in the `.gitattributes` file).

So, is it possible to do something like that? If yes, is my sample `.gitattributes` should work?

Regards, Matt

Next: Jeff King
Message 1 of 2 in “.gitattributes and defaulting to binary”
  1. Matthieu VachonSep 16, 2013
  2. Jeff KingSep 16, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.