Development

[git] credentials push가 안될 때

sj.cath 2025. 1. 12. 16:25
# 현재 커밋에서 파일 추적 중단
git rm --cached {추적 중단하고자 하는 파일 이름}
git commit -m "Stop tracking "

# 과거 커밋에서 파일 삭제 (BFG 사용)
bfg --delete-files {추적 중단하고자 하는 파일 이름}

# Git 저장소 정리
git reflog expire --expire=now --all
git gc --prune=now --aggressive

# 강제 푸시
git push origin {푸쉬하고자 하는 브랜치} --force