git 删除文件 - 包括所有提交历史

git 删除文件 - 包括所有提交历史

# 删除包括历史
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch 文件相对路径' --prune-empty --tag-name-filter cat -- --all
# 同步到远程
git push origin master --force

参考文档

  • http://www.cnblogs.com/shines77/p/3460274.html
  • fatal: bad revision rm
  • https://www.jianshu.com/p/58fef32a15bb
  • git-filter-branch
  • Git-工具-重写历史

你可能感兴趣的:(git 删除文件 - 包括所有提交历史)