터미널에서 git add . 를 실행했을 때 아래와 같은 에러 메세지가 발생했다.
warning: in the working copy of 파일, LF will be replaced by CRLF the next time Git touches it
원인
OS마다 줄바꿈 문자열이 다르기 때문에 GIT에서 어떻게 받아들여야할지 몰라 에러 메세지를 띄운 것.
LF : MAC, Linux에서 사용되는 줄바꿈 문자열(\n)CRLF : Window에서 사용되는 줄바꿈 문자열(\r\n)
해결방법
core.autocrlf : LF와 CRLF를 서로 변환해주는 기능.
* 해당 프로젝트에만 적용할 거라면 -- global 옵션을 빼고 적용한다.
Windows, DOS 명령어
git config --global core.autocrlf true
git config core.autocrlf true
Linux, MAC 명령어
git config --global core.autocrlf input
git config core.autocrlf input
기능 해제
git config --global core.autocrlf false
'GIT' 카테고리의 다른 글
[Git] 깃허브 토큰 생성 하는 법 / remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. (0) | 2023.10.24 |
---|---|
GIT과 GITHUB 연동하기 (0) | 2023.09.17 |