Git

[Git] git add . CRLF will be replaced by LF in warning 해결

mswait 2022. 2. 22. 13:32

문제상황 : git add를 하려는데 다음과 같은 warning을 출력.

원인 : 플랫폼(OS)마다 줄바꿈을 바라보는 문자열이 다르기에 형상관리를 해주는 Git이 바라볼 땐 둘 중 어느 쪽을 선택할지 몰라 경고 메세지를 띄워준 것.

 

\r\n <- 이런게 운영체제(Mac, Window) 에 따라 달라서.

 

warning: CRLF will be replaced by LF in .idea/misc.xml.
The file will have its original line endings in your working directory
warning: CRLF will be replaced by LF in app/src/main/AndroidManifest.xml.
The file will have its original line endings in your working directory

해결

$ git config core.autocrlf true

 

--global 옵션을 주는 것도 가능하다.

 

 

참고 블로그:

https://dabo-dev.tistory.com/13

 

[Git 경고 메세지] LF will be replaced by CRLF in 해결 방안

안녕하세요(・∀・)ゞ Git을 설치하고 GitBash에서 git add 명령어를 입력했는데 git add bora.txt warning: LF will be replaced by CRLF in bora.txt. The file will have its original line endings in your..

dabo-dev.tistory.com