Develop/Git
Git Rm
Programics
2022. 3. 1. 02:42
반응형
Remove files from the working tree and from the index
작업 트리 및 색인에서 파일 제거
* 로컬 및 원격저장소 파일 삭제
git rm filename
e.g. git rm index.html
* 원격저장소만 파일 삭제
git rm --cached filename
e.g. git rm --cached index.html
- 옵션 -r : 내부값까지 삭제 (css, img, js는 디렉토리)
e.g. git rm -r --cached css img js index.html
- 삭제 이후, commit과 push까지 해야 github가 변경됨
e.g. git commit -m "file delete"
e.g. git push origin main
반응형