1
0
forked from uestc/Notes
Notes/代码同步协作(Git)/Git高级操作-麻烦问题解决.md
2024-10-17 15:36:48 +08:00

12 lines
480 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1、Git 某次Commit 有大文件导致Github无法提交上去
解决方案是把这个大文件从历史的所有提交剔除,如下面的命令所示:
```shell
# 使用双引号将文件路径括起来
# 当你的路径存在空格的时候容易导致命令行识别错,可以把你要删除的路径的文件加上""
git filter-branch --force --index-filter 'git rm --cached -r --ignore-unmatch "your path"' --prune-empty --tag-name-filter cat -- --all
```