Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. ## BEGIN Remove folder retroactively
  2.  
  3. git filter-branch -f --tree-filter 'rm -rf FOLDERNAME' --prune-empty HEAD
  4. git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
  5. echo FOLDERNAME >> .gitignore
  6. git add .gitignore
  7. git commit -m "Fixing git repo REMOVED: FOLDERNAME"
  8. git gc
  9. git push -f origin master
  10.  
  11. ## END Remove folder retroactively
  12.  
  13. ## BEGIN Remove all files retroactively from repo
  14. git filter-branch -f --tree-filter "find . -type f -name '*.extension' -exec rm {} \;" --prune-empty HEAD
  15. git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
  16. echo *.extension >> .gitignore
  17. git add .gitignore
  18. git commit -m "Fixing git repo REMOVED all files with EXTENSION"
  19. git gc
  20. git push -f origin master
  21.  
  22. ## END Remove all files retroactively from repo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement