실수로 Secret Key
를 안 빼두고 Github
에 push
했덩;;
부랴부랴 .env
로 Secret key
들을 환경변수로 빼놓았으나,
from decouple import config
client_id = config('client_id')
Secret_Key = config('Secret_Key')
Github
의 Commit
내역에 남아있는 Secret key
들은 그대로...
git filter-branch
로 해결 가능했덩.
git filter-branch --force --tree-filter "sed -i '' 's/7ong/***REMOVED***/' file.py"
내 repo
의 file.py
에 있는 "7ong"
을 전부 "***REMOVED***"
로 바꿔주는 마법~!
과거 commit
에 남아있는 기록들까지 전부 바꿔준덩.
--force
없이 해당 command
를 여러 번 사용한다면,
Cannot create a new backup.
A previous backup already exists in refs/original/
Force overwriting the backup with -f
요런 error code
가 뜨게 됩니덩;
마지막으로 force push
해주는 것 잊지마렁!!
git filter-branch --force --tree-filter "sed -i '' 's/[A]/[B]/' file.py"
git push --force
~끗~