개발자가 된 감자

[Git] LF will be replaced by CRLF the next time Git touches it 본문

Error 해결

[Git] LF will be replaced by CRLF the next time Git touches it

감자씨 2024. 11. 15. 23:11
728x90

error_log

 


이클립스에서 작업 후 git bash 에서 git add . 명령어를 실행시켰는데 해당 오류가 발생했다.

$ git add .
warning: in the working copy of 'src/main/resources/application.properties', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'src/main/java/com/potato/ChatApplication.java', LF will be replaced by CRLF the next time Git touches it

 

OS 마다 줄바꿈 문자열이 다르기 때문에 형상관리를 해주는 git에서 경고메세지를 준 것이다.


해결 방안
해당 프로젝트에만 적용하고 싶을 경우 --global 명령어는 제외 가능하다.

# Window 전용 명령어 CRLF -> LF로 변경
git config --global core.autocrlf true

# Linux 전용 명령어 LF -> line ending으로 사용
git config --global core.autocrlf input

해당 설정을 적용시키고 다시 git add . 명령어를 실행시키니 정상적으로 구동되었다.

 

728x90
Comments