sharingStorage

git error 해결법 - warning: LF will be replaced by CRLF in 본문

git

git error 해결법 - warning: LF will be replaced by CRLF in

Anstrengung 2022. 2. 22. 13:58

git add .  명령어 사용시 발생한 error

 

errorcode: warning: LF will be replaced by CRLF in src/components/Popup.svelte (in 이하 폴더위치)

The file will have its original line endings in your working directory

원인 :

Unix 시스템에서 줄의 끝은 줄바꿈(LF)로 표시되는데 window시스템에서 줄은 캐리지 리턴(CR)과 줄바꿈(LF)로 표현되므로 CRLF이다. 따라서 Unix 시스템에서 업로드된 git에서 코드를 받으면 LF만 있다.

 

해결 :

Window시스템에서만 작업하는 단일 개발자이고 git이 자동으로 LF를 CRLF로 바꾸는 것에 신경쓰지 않는다면 git config core.autocrlf true로 경고를 끌 수 있다.

 

Windows, DOS 명령어

git config --global core.autocrlf true

Linux, MAC 명령어

git config --global core.autocrlf input

 

 

Reference

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

 

Comments