git commit한 파일 제거
- git commit 한 파일을 이제 빼고자 할 때
git rm --cached 파일명
git commit --amend
- 이걸 응용해서 이미 커밋에 올라가있는 파일을 제거하려면
git rebase -i 이전커밋
git rm --cached 파일명
git commit --amend
git rebase --continue
- 좀 더 응용해서 initial commit 에 잘 못넣은 ( git ignore 에 추가하지 못한 ) 파일 제거
git rebase -i --root
git rm --cached 파일명
git commit --amend
git rebase --continue
PREVIOUSgit comment의 종료