// Delete a single file
git filter-repo --invert-paths--use-base-name--path'some-image-that-was-not-needed.png'
// Delete many matching files
git filter-repo --invert-paths--use-base-name--path-glob'*.apk'--path-glob'*.app'--path yarn.lock
// Delete a folder
git filter-repo --invert-paths--use-base-name--path build
(--invert-paths is needed here as by default filter-repo will keep what matches, so you need to tell it to keep everything but what you want to remove)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Fwiw, do you know about git filter-repo? It's the officially recommended replacement for git filter-branch, and does what you needed to do and much more.
Your commands map to it as:
Approach 1
Approach 2
(
--invert-pathsis needed here as by default filter-repo will keep what matches, so you need to tell it to keep everything but what you want to remove)