Last active
July 10, 2019 21:00
-
-
Save victorprocure/1520caac1e3378d8dfb68e9cb052e8c4 to your computer and use it in GitHub Desktop.
Well used git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## BEGIN Remove folder retroactively | |
git filter-branch -f --tree-filter 'rm -rf FOLDERNAME' --prune-empty HEAD | |
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d | |
echo FOLDERNAME >> .gitignore | |
git add .gitignore | |
git commit -m "Fixing git repo REMOVED: FOLDERNAME" | |
git gc | |
git push -f origin master | |
## END Remove folder retroactively | |
## BEGIN Remove all files retroactively from repo | |
git filter-branch -f --tree-filter "find . -type f -name '*.extension' -exec rm {} \;" --prune-empty HEAD | |
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d | |
echo *.extension >> .gitignore | |
git add .gitignore | |
git commit -m "Fixing git repo REMOVED all files with EXTENSION" | |
git gc | |
git push -f origin master | |
## END Remove all files retroactively from repo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment