我正在尝试使用 gitfilter-branch功能删除最近更新和提交的文件。我尝试运行以下命令:
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch myfile' --prune-empty --tag-name-filter cat -- 6f7fda9..HEAD
Run Code Online (Sandbox Code Playgroud)
但是,这只会从主分支中删除文件,我希望将其从所有分支中删除。
与承诺开始6f7fda9向HEAD我要删除的文件。我运行的命令是错误的吗?
git filter-branch -- --all在所有分支上运行过滤器。所以:
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch myfile' --prune-empty --tag-name-filter cat -- --all
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1648 次 |
| 最近记录: |