removing file from git history doesn't work

匿名 (未验证) 提交于 2019-12-03 03:02:02

问题:

I'm trying to remove a file which has sensitive data using this GitHub procedure.

However, this doesn't 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 

It completes with:

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

Everything up-to-date

Does anyone know what I'm doing wrong?

回答1:

Per discussion in comments, use the complete path of the file. The current version of the command is excising some_file.json in the top level repo directory.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!