반응형
파일 삭제
1. 로컬 디렉토리에서는 유지, git 저장소에서만 삭제
git rm --cached file_name.js
git commit -m "Remove file_name.js on git"
2. 로컬 디렉토리와 git 저장소에서 동시 삭제
git rm file_name.js
git commit -m "Remove file_name.js"
디렉토리 삭제
1. 로컬 디렉토리에서는 유지, git 저장소에서만 삭제
git rm --cached -r .idea
git commit -m "Remove .idea folder"
2. 로컬 디렉토리와 git 저장소에서 동시 삭제
git rm -rf folder_name
git commit -m "Remove folder_name"
반응형
'기타 > git' 카테고리의 다른 글
[git] 깃 명령별(pull, merge, commit, add) 취소하고 되돌리기 (0) | 2024.03.17 |
---|---|
[git] 커밋 메시지 수정하기 (0) | 2023.04.18 |