WorkaHolic

Git Rm 본문

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

반응형

'Develop > Git' 카테고리의 다른 글

Branch를 Main(a.k.a. Master)로 변경  (0) 2021.05.24
Git 세팅  (0) 2021.05.24
Git Log  (0) 2021.05.24
Git Merge  (0) 2021.05.24
Git Reset  (0) 2021.05.24