git cache 삭제

yanju·2022년 11월 17일
0
post-thumbnail

.gitignore에 폴더나 파일을 추가했지만 반영이 안되는 경우가 있다.

이럴 때 cache를 삭제 해 문제를 해결할 수 있다.

아래와 같은 명령어로 캐시 삭제를 수행한다.

git rm -r --cached .
git add .
git commit -m "캐시 삭제"

또는 다음과 같이 한 파일만 cache를 삭제한다.

git rm --cached FILENAME

다음과 같이 공식문서를 보면 명령어를 확인할 수 있다.

image

참고

https://git-scm.com/docs/gitignore

https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files?platform=linux

0개의 댓글