문제

I have a git repository I originally used with msysgit, but now I've begun to use github instead. For some reason, when I add the default recommended .gitattributes file to deal with line endings, most of the files in the repository need to be recommitted. Is this supposed to happen? I'm currently on a Windows computer and use Assembla.com as the central origin repo.

도움이 되었습니까?

해결책

It depends on the exact configuration you are using in your .gitattributes

From the gitattributes docs:

End-of-line conversion

While git normally leaves file contents alone, it can be configured to normalize line endings to LF in the repository and, optionally, to convert them to CRLF when files are checked out.

So it seems there are certain configurations where it will modify the contents of the files to change their line endings, thus resulting in the repo wanting you to commit the changes.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top