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

Re: Gitattributes file is not respected when switching between branches

From
Torsten Bögershausen <tboegi@web.de>
Date
Sep 12, 2016, 19:35 UTC
Message-ID
<8df2883f-ec3c-3446-2e06-207c93452332@web.de>
In-Reply-To
<CANYoZJng0GNZWU=eUEnXgVQ_NKQQOKM+mhJ9bsXMEJxxEhwQMw@mail.gmail.com>
On 12.09.16 14:55, Виталий Ищенко wrote:
Show 27 quoted lines
> Good day
>
> I faced following issue with gitattributes file (at least eol setting)
> when was trying to force `lf` mode on windows.
>
> We have 2 branches: master & dev. With master set as HEAD in repository
>
> I've added `.gitattributes` with following content to `dev` branch
>
> ```
> * text eol=lf
> ```
>
> Now when you clone this repo on other machine and checkout dev branch,
> eol setting is not respected.
> As a workaround you can rm all files except .git folder and do hard reset.
>
> Issue is reproducible on windows & unix versions. Test repo can be
> found on github
> https://github.com/betalb/gitattributes-issue
>
> master branch - one file without gitattributes
> feature-branch - .gitattributes added with eol=lf
> unix-feature-branch - .gitattributes added with eol=crlf
>
> Thanks,
> Vitalii
Some more information may be needed, to help to debug.

Which version of Git are you using ? What does

git ls-files --eol
say ?
Previous: Виталий ИщенкоNext: Torsten Bögershausen
Message 2 of 5 in “Gitattributes file is not respected when switching between branches”
  1. Виталий ИщенкоSep 12, 2016
  2. Torsten BögershausenSep 12, 2016
  3. Torsten BögershausenSep 12, 2016
  4. Виталий ИщенкоSep 16, 2016
  5. Torsten BögershausenSep 18, 2016

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.