由于Github 有单一的文档大小限制,如果超过了100MB就会显示上传失败出现下面的情况。
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: da815a6d6f452ecffe5fa628c59519a8
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File crawlTPL/data/reusageMapping.csv is 332.44 MB; this exceeds GitHub's file size limit of 100.00 MB
在这里显示了我的文档 reusageMapping.csv is 332.44 MB 是332,44MB已经超过了他的限制。这个时候我们需要使用git filter-branch 将这个档案从我们的 git repository里面删除。
- 首先我们需要跳转到我们的git 根目录下
cd YOUR-REPOSITORY
- 将这个文档从我们的git 记录中删除,我已开始直接先用 rm 删除的,然后在 git add -A 和 commit了一下。之后在用的这个命令
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA" \
--prune-empty --tag-