Git: fix linebreaks in file (autocrlf was working fine, but one file seems to have gotten stuck)

StackOverflow https://stackoverflow.com/questions/15145498

Вопрос

I’m collaborating cross-platform via github, and up till now, autocrlf has been doing a beautiful job of transparently managing our line break formats.

However, after a recent manual merge, one file ended up with a mix of CR and CRLF endings, and since then it has seemed to be “stuck” in that state — I’ve pushed it and checked out my local copy of it a few times, but it still retains the mixed line breaks.

How can I ask autocrlf to start handling this file again? (From reading around, if I understand right, manually fixing the linebreaks in my editor would explicitly show up in the next commit, and so would obscure the file history — so I would prefer to avoid this if possible.)

Это было полезно?

Решение

If the mixed linebreaks have gotten into the repository there is no other way than manually fixing them and creating a history entry for that change.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top