깃허브에 개인 과제물을 올리려고 새 레파지토리에 처음 올리자 vscode 터미널에 이런 오류가 떴다.
warning: in the working copy of 'package.json', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/App.js', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/style/App.css', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/style/index.css', LF will be replaced by CRLF the next time Git touches it
깃에서 줄 끝 문자에 대한 경고 메세지는 윈도우 환경에서 발성한다.
윈도우는 crlf로 사용하고 리눅스는 lf로 사용하기 때문이다.
이미 변환된 상태이므로 추가 변환을 하지 않도록 명령어를 치면 된다.
git config --global core.autocrlf false
위 명령어를 치면 된다.
-core.autocrlf가 true로 설정되면 Git은 파일을 커밋할 때 LF를 CRLF로 변환하고, 체크아웃할 때 CRLF를 LF로 변환합니다. (주로 Windows 환경에서 사용됨)
-core.autocrlf가 input으로 설정되면, 커밋할 때는 LF를 유지하고, 체크아웃할 때만 CRLF로 변환합니다.
-core.autocrlf가 false로 설정되면 Git은 줄 바꿈 문자를 변환하지 않습니다.