从git历史记录中删除文件-错误的修订错误 [英] Removing files from git history - bad revision error

查看:62
本文介绍了从git历史记录中删除文件-错误的修订错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照Github上的说明进行操作( https://help.github.com /articles/remove-sensitive-data/)整理凌乱的存储库.我已经使用

I am following the instructions on Github (https://help.github.com/articles/remove-sensitive-data/) to tidy up a messy repository. I have successfully cleared out all the .csv files using

git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch *.csv' \
--prune-empty --tag-name-filter cat -- --all

现在需要删除所有.docx文件.但是,当我对* .docx使用完全相同的命令时,出现一条错误消息: fatal: bad revision ' --prune-empty'

And now need to remove all the .docx files. However, when I use exactly the same command with *.docx instead, I get an error saying: fatal: bad revision ' --prune-empty'

我将其推到github上的原始位置,并在进行第二次更新之前克隆了一个新副本.我不确定自己做错了什么/不同地导致了此错误.任何帮助,不胜感激:)

I pushed to the origin on github, and cloned a fresh copy before doing this second lot of updates. I'm not sure what I'm doing wrong/differently that is causing this error. Any help greatly appreciated :)

推荐答案

已解决...我在--prune-empty部分之前加了反斜杠后的空格,现在可以正常使用了! 不知道为什么它起作用....

Solved... I took out the space after the backslash which I'd been putting in before the --prune-empty part, and it works as expected now! No idea why it works though....

这篇关于从git历史记录中删除文件-错误的修订错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆