git如何删除某个文件的所有历史记录

作者:Liaodeity - 2021年04月16日

执行命令后会目标文件进行删除,操作前可以备份一下。

1、resources/views/layouts/home.blade.php为你需要删除的文件

git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch resources/views/layouts/home.blade.php' --prune-empty --tag-name-filter cat -- --all

2、提交本地修改到远程,所有分支以及标签

git push origin --force --all
git push origin --force --tags


本文作者: Liaodeity

本文链接: https://www.jianbaizhan.com/article/727

版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 许可协议。转载请注明出处!


 请勿发布不友善或者负能量的内容。审查将对发布广告等违规信息进行处罚!