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
I was trying to : Removing sensitive data and history from a repository and ,
While trying above solution. I found this youtube video, It worked form me : With the reference of the video :
Command : We need to run this command form git root directory and user relative path of the file in the following command.
$ git filter-branch --index-filter 'git rm --cache --ignore-unmatch /root-app/props/password.properties' HEAD
Output :
$ git filter-branch --index-filter 'git rm --cache --ignore-unmatch ./root-app/props/password.properties' HEAD
Rewrite 7243bb0ad4f3aca3a35e2b5ca86926856e77b666 (14860/14864) (1011 seconds passed, remaining 0 predicted) rm 'root-app/props/password.properties'
Rewrite 36c00b1203edf35321c0a0204e2fcb6341a5436d (14860/14864) (1011 seconds passed, remaining 0 predicted) rm 'root-app/props/password.properties'
Rewrite d6bf5d98ec548113f47b9dc7b6dcecf357fdf8db (14860/14864) (1011 seconds passed, remaining 0 predicted) rm 'root-app/props/password.properties'
I hope it will work for others as well.
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 !!!
git filter-branch --index-filter 'git rm --cached --ignore-unmatch Resources\Video\%font%.ttf' HEAD
can be much (up to 100x) faster than --tree-filter
because it only updates git history and not the working directory.
ref: What is the difference between "--tree-filter" and "--index-filter" in the "git filter-branch"?
ref: https://git-scm.com/docs/git-filter-branch