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

Re: .gitattributes and defaulting to binary

From
Jeff King <peff@peff.net>
Date
Sep 16, 2013, 22:09 UTC
Message-ID
<20130916220908.GC5477@sigill.intra.peff.net>
In-Reply-To
<CAOTvmonjWtUM42ATpEu+s6GVcpTO10BT0izXVB_aqK2npgRfWQ@mail.gmail.com>
On Mon, Sep 16, 2013 at 05:35:24PM -0400, Matthieu Vachon wrote:
Show 6 quoted lines
> 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
>From "git help attributes":
  When more than one pattern matches the path, a later line overrides an
  earlier line. This overriding is done per attribute.
Reversing the two lines should do what you want.

You may also want to use "-text" instead of "binary"; the latter also implies "-diff", which means you will never see diffs of those files, even if they are actually text.

-Peff
Previous: Matthieu Vachon
Message 2 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.