Deleting a file from git history does not work

I am trying to delete a file with sensitive data using this GitHub procedure .

However, this does not work for my specific repo. When I run:

git filter-branch --index-filter 'git rm --cached --ignore-unmatch some_file.json' \
  --prune-empty --tag-name-filter cat -- --all

Running from:

Rewrite 73f9cce9ab282cec272022314f361c1cd48955a7 (418/418)  
WARNING: Ref 'refs/heads/master' is unchanged     
WARNING: Ref 'refs/remotes/origin/blah' is unchanged    
WARNING: Ref 'refs/remotes/origin/blah2' is unchanged     
WARNING: Ref 'refs/remotes/origin/blah3' is unchanged     
WARNING: Ref 'refs/remotes/origin/blah4' is unchanged     
WARNING: Ref 'refs/remotes/origin/master' is unchanged

But nothing has changed. When i do

git push origin master --force 

it says

All updated

Does anyone know what I'm doing wrong?

+5
source share
1 answer

For discussion in the comments, use the full path to the file. The current version of the command excludes some_file.jsonthe top-level repository directory.

+6
source

All Articles