diff --git a/changeGitHistroy.md b/changeGitHistroy.md new file mode 100644 index 0000000..18f992b --- /dev/null +++ b/changeGitHistroy.md @@ -0,0 +1,33 @@ +# How to change the History of a git repo + +This is usefull if you want to permanently delete something form a git repo +(attackers can clone the repo and revert commits which deleted files). This +Methode rewirtes the git History + +Step1: +clone repo again (you might break stuff) + +Step2: +install git-filter-repo +``` +sudo pacman -S git-filter-repo +``` + +Step3: +use git-filter-repo to delete files + +``` +git filter-repo --invert-paths --path +``` + +Step4: +add origin again +``` +git remote add origin +``` + +Step5: +force push +``` +git push origin --force --all +```