카테고리 없음

git 특정파일만 commit 히스토리에서 삭제하기

imsongkk 2022. 12. 30. 14:39
git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch src/main/resources/application-jwt.yml' --prune-empty -- --all

src/main/resources/application-jwt.yml 파일을 history삭제한다.(로컬에 존재하는 파일은 삭제되지 않음)

 

이후 

 

git push -f origin --all

 

해서 remote에도 반영되도록 하자

 

키값을 실수로 remote에 잘못올려서 고생 ㅠ