git replacing LF with CRLF

前端 未结 20 1682
眼角桃花
眼角桃花 2020-11-21 23:31

Running git on a Windows XP machine, using bash. I exported my project from SVN, and then cloned a bare repository.

I then pasted the export into the bare repositori

20条回答
  •  不要未来只要你来
    2020-11-22 00:28

    http://www.rtuin.nl/2013/02/how-to-make-git-ignore-different-line-endings/

    echo "* -crlf" > .gitattributes 
    

    Do this on a separate commit or git might still see whole files as modified when you make a single change (depending on if you have changed autocrlf option)

    This one really works. Git will respect the line endings in mixed line ending projects and not warning you about them.

提交回复
热议问题