Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement