[Git 경고]LF will be replaced by CRLF

Yeong·2023년 11월 8일

Git

목록 보기
3/3
warning: in the working copy of 'dist/movie.3464ddca.js', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'package-lock.json', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'package.json', LF will be replaced by CRLF the next time Git touches it

git add를 하는데 LF will be replaced by CRLF the next time Git touches it 경고 메세지가 떴다.

번역하자면 다음에 Git이 LF를 처리할 때 LF는 CRLF로 대체됩니다. 라는 의미로 여기서 LF와 CRLF가 무엇이냐면 운영체제 별 줄바꿈을 의미한다.

LF(Line-Feed)

Mac, Linux (Unix 계열) 줄바꿈 문자열 = \n 

CRLF (Carriage-Return+Line-Feed)

Windows, DOS 줄바꿈 문자열 = \r\n

해결방안

autocrlf으로 미리 어떻게 처리할지 설정해 두면된다.

  • core.autocrlf = true
    CRLF > LF 변경

git config --global core.autocrlf true global을 추가해 전역 설정을 지정해 줄수 있다.

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

profile
긍정적으로~✍️(◔◡◔)

0개의 댓글