Remove Files completely from git repository along with its history

Yosh Iku3 picture Yosh Iku3 · Jan 31, 2016 · Viewed 20.4k times · Source

I have uploaded a font file that I don't have the rights to distribute to git hub several updates ago.

I have a relatively inactive repository and I have the ability to notify all of my members if necessary. I've tried several of the solutions. I need to delete a file in my directory called Resources\Video\%font%.ttf where %font% is the name of the plain, italicized and bold versions of the font. What commands do I use?

Answer

Gupta picture Gupta · Jan 31, 2016

In that case you could to use Git Filter Branch command with --tree-filter option.

syntax is git filter-branch --tree-filter <command> ...

git filter-branch --tree-filter 'rm -f Resources\Video\%font%.ttf' -- --all

Explanation about the command:

< command >: Specify any shell command.

--tree-filter: Git will check each commit out into working directory, run your command, and re-commit.

--all: Filter all commits in all branches.

Note: Kindly check the path for your file as I'm not sure for the file path

Hope this help you !!!