Gitattributes file is not respected when switching between branches
- From
- Виталий Ищенко <betalb@gmail.com>
- Date
- Sep 12, 2016, 12:55 UTC
- Message-ID
- <CANYoZJng0GNZWU=eUEnXgVQ_NKQQOKM+mhJ9bsXMEJxxEhwQMw@mail.gmail.com>
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