.gitignore
안에 넣어야 할 파일을 github저장소에 이미 올라가고
.env
과 node_modules
를 삭제 해야 하는 상황이다.
git rm --cached 파일명
git rm --cached -r 폴더명
git rm 파일명
git rm -r 폴더명
.
.
--cached:
원격저장소만
-r:
recursive(재귀적으로), 디렉토리와 하위 내용 삭제
git rm --cached -r node_modules
git rm --chched -r .env
.
.
삭제하고 push하면
node_modules과 .env 파일이 삭제 된 것을 볼 수 있다.