728x90
캐시 삭제를 하지 않을 경우 gitignore가 적용이 되지 않을 수 있다.
(애써 만든 gitignore 적용시켜야지ㅠㅜㅠㅠㅠㅠㅠ)
gitignore가 작동되지 않을때 대처법 -> git 캐시 삭제하기
💡 .gitignore가 작동되지 않을때 대처법
$ git rm -r --cached .
$ git add .
// 당연히 git commit과 git push를 진행해야한다.
git에 올릴 때는 개인 정보, 서버, DB, id, pw 포함 될 수 있으니 조심!
만약 캐시를 삭제했는데 모든 파일이 안보일 수 있다.
그럴 때 당황하지 말고 gitignore를 살펴봐야한다.
아마. gitignore 설정을 잘못했으리라...
728x90
'개발&etc > Git' 카테고리의 다른 글
[Git] ![remote rejected] main -> main (pre-receive hook declined) 에러 (0) | 2023.02.28 |
---|---|
[Git] Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch 에러메세지 해결 (0) | 2023.02.27 |
[Git] Gitignore 특정 파일 숨기기 (0) | 2023.02.22 |
[Git] Git add commit 한꺼번에 날리기 + add commit push 날리기 (0) | 2023.02.22 |
[Git] Git 특정 파일 추적 제거 (0) | 2023.02.22 |