문제상황 : 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
'Git' 카테고리의 다른 글
[Git] git 최초설정, 사용자 이름과 이메일 입력하기 git config (0) | 2022.02.22 |
---|---|
[Git] git init, git status (0) | 2022.02.22 |
[Git] origin,remote 의미 (0) | 2022.02.22 |
[Git] git pull, 병합 (0) | 2022.02.22 |
[Git] git push, git pull가 안되는 경우 (fatal: refusing to merge unrelated histories) (0) | 2022.02.22 |