đģ Git Quick Ref.
Just enough to be dangerous
echo $PWD
Current dir the project dir? Great. Continue..
No? Then
cd ~/.sources/projectdirectory
. See Bash prompt links belowgit add .
Or:
git add example1.sh
git commit -m "commit message"
git pull
git push -u origin
This won’t remove it from clones or forks, but at least the repo will be scrubbed
BFG Repo-Cleaner linked below
vim ~/.bashrc
++ alias bfg='java -jar ~/.sources/bfg-1.14.0.jar'
source ~/.bashrc
bgf
via new Bash promptsecho "sensitive_data_to_be_removed" >> ~/passwords.txt
OR:
echo -en "data1\ndata2\ndata3" >> ~/passwords.txt
cd ~/.sources/gitrepo
This will obviously work better in the repo directory
bfg --replace-text ~/passwords.txt
Crucial step to clear repo history of that data
git reflog expire --expire=now --all && git gc --prune=now --aggressive
bfg
should prompt you to issue the the above commandgit push --force
That should do it. Good luck!