기타

[Git] will not add file alias ~ 오류

일 월 2022. 11. 2. 22:33

프로젝트를 진행하며 git을 사용하는 도중 위와 같은 오류가 떴다.

 

초기 설정 시 'Frontend'로 폴더명을 설정했다가, 설정이 바뀌면서 폴더를 지우고  'frontend' 폴더를 생성한 뒤 생긴 오류였다. 

 

검색해보니 '수정 전 파일 이름과 수정 후 파일 이름의 대소문자 ignorecase 때문에 생기는 오류'라고 한다.

 

git config --local core.ignorecase false

git config --global core.ignorecase false

위의 명령어 중에 하나를 입력해서 대소문자 구분을 설정해줘서 문제를 해결했다.

 

협업 도중에 일어난 오류라, gitlab에는 frontend, Frontend가 모두 올라가 있어서 혼선이 있었는데, 다음부터는 이런 오류가 생기지 않도록 유의해야 할 것 같다.

 

 

 

참고

 

“Will not add file alias '~~~' ('~~~' already exists in index)” 오류

커밋할시에 수정하기 전 파일 이름과 수정후의 파일 이름의 대소문자 ignorecase 때문에 생기는 오류이다. ...

blog.naver.com

 

 

"Will not add file alias 'samefile' ('SameFile' already exists in index)" when `git add` operation

I download linux' kernel source, and want to git add them all. When I git add ., git starts add them. But soon it returns an error: fatal: Will not add file alias 'include/linux/netfilter/xt_conn...

stackoverflow.com