반응형

git diff 제대로 안될 때

\r 때문이라면
\r=CR(Carriage Return) // Used as a new line character in Mac OS before X 캐럿이 그 줄 맨 앞으로
\n=LF(Line Feed) // Used as a new line character in Unix/Mac OS X 캐럿이 다음 줄로
\r\n=(End Of Line) CR + LF // Used as a new line character in Windows
해결방법
git config --global core.autocrlf true 로 설정변경

git config --global -l 로 확인함

https://www.lesstif.com/pages/viewpage.action?pageId=20776404 참조

 

아래와 같이 LF로 바꿔도 계속 다시 crlf로 자동변환하는데 이거 안하게 하는 방법은?

$ git stash
warning: LF will be replaced by CRLF in src/main/java/com/lge/cdp/model/Program.java.
The file will have its original line endings in your working directory.

 

반응형

'git' 카테고리의 다른 글

git rebase, cherry-pick을 잘 이해해보자  (0) 2019.06.11
git tag  (0) 2019.06.07
gerrit  (0) 2019.04.30
Git: ssh public key 등록  (0) 2019.04.26
git  (0) 2019.04.26

+ Recent posts