git 파일 및 폴더명 대소문자 오류
- 최근 프로젝트를 진행하면서 컴포넌트의 폴더 구조 및 이름을 수정하던 도중, 폴더 명의 대소문자를 변경했음에도 불구하고 해당 변경 사항이 반영되지 않은 채
dev
에merge
되어 빌드 오류가 지속적으로 났다. 확인해보니git config core.ignorecase
에 대한 이슈였다.
git config core.ignorecase
Internal variable which enables various workarounds to enable Git to work better on filesystems that are not case sensitive, like APFS, HFS+, FAT, NTFS, etc. For example, if a directory listing finds "makefile" when Git expects "Makefile", Git will assume it is really the same file, and continue to remember it as "Makefile".
The default is false, except git-clone[1] or git-init[1] will probe and set core.ignoreCase true if appropriate when the repository is created.
git
공식문서의 내용을 바탕으로 간단히 정리하자면,git
은 기본적으로 파일 및 폴더명의 대소문자를 따로 구분하지 않는다. 때문에git config core.ignorecase
의boolean
값을 변경함으로써 대소문자를 구별하도록 설정할 수 있다. (이전에 작업할때는 파일의 대소문자 변경은 정상적으로 반영이 되고 폴더명만 반영이 되지 않았다.. 뭐지?.. )git init
이나git clone
을 통해 생성이 된git
의 경우, 기본값은true
이다. 때문에 대소문자를 구별할 수 없었던 것이었다.(실제로 확인해보니CRA
,NEXTjs
프로젝트 또한 기본값이true
로 설정되어 있음을 알 수 있었다.)- 결론적으로
git config core.ignorecase
를false
로 설정하면, 대소문자 변경에 대한 인식을 할 수 있다.
Reference
'Etc' 카테고리의 다른 글
TIL | Webstorm IDE Setting Share (0) | 2022.03.01 |
---|---|
TIL | MSW(Mock Service Worker) (0) | 2022.02.07 |
TIL | testing-library, Jest-Dom eslint 설정하기 (0) | 2022.01.15 |
TIL | Atomic design pattern 간단 정리 (0) | 2022.01.10 |
TIL | Docker-compose 세팅 및 적용하기 (0) | 2021.12.05 |