소문자로 파일이나 디렉토리를 생성하였다가 대문자로 변경하였을 경우 git changes에 잡히지 않거나 컴포저(Composer) autoload.php 생성단계에서 다음과 같은 에러 문구를 만날 수 있다.

Class App\View\Components\User\SignUpForm located in ./app/View/Components/user/SignUpForm.php does not comply with psr-4 autoloading standard. Skipping.

Class App\View\Components\User\LoginForm located in ./app/View/Components/user/LoginForm.php does not comply with psr-4 autoloading standard. Skipping.

Class App\View\Components\User\ProfileRounded located in ./app/View/Components/user/ProfileRounded.php does not comply with psr-4 autoloading standard. Skipping.

Class App\View\Components\Utils\Popper located in ./app/View/Components/utils/Popper.php does not comply with psr-4 autoloading standard. Skipping.

실제로 파일/디렉토리를 User와 Utils 처럼 대문자로 잘 생성돼 있지만, 이전에 소문자로 한 번 생성한 이력이 있기 때문에 위와 같은 문제가 발생한다.

해결법

$ git config --global core.ignorecase false

일단 앞으로도 이와 같은 불상사를 방지하기 위해 대소문자 무시하는 옵션을 꺼준다. 이후 이미 한 번 커밋된 파일들의 이력들을 지우기 위해 다음과 같이 명령어들을 경로에 맞춰 실행해준다.

$ git rm --cached app/View/Components/user/*
$ git rm --cached app/View/Components/utils/*

모든 이력들이 지워졌고, 새로 추가된 파일들(즉, 소문자로 쌓은 로그들이 지워졌고 대문자로 시작된 디렉토리에 파일들이 발견되었기 때문)을 다시 커밋하여 이력을 쌓아준다.

+ Recent posts