WORK/Trouble

[오류/Git] .gitignore가 작동하지 않을 때/.gitignore 커밋 오류

Justin Mendes 2023. 6. 21. 21:57

에러 : .gitignore가 제대로 작동되지 않아서 ignore처리된 파일이 계속 changes에 나올때가 있다.

 

찾아보니 git의 캐시가 문제가 되는거였다.

terminal에 아래 명령어로 캐시 내용을 전부 삭제 후 다시 add All해서 커밋하면 해결된다.

git rm -r --cached .
git add .
git commit -m "fixed untracked files"

 

참고 : https://stackoverflow.com/questions/11451535/gitignore-is-ignored-by-git