Git:文件太大,添加到git时忽略,但仍在尝试添加

时间:2018-08-09 10:04:26

标签: git

我收到此错误

远程:错误:文件_____是262.63 MB;这超出了GitHub的文件大小限制100.00 MB

所以我将文件添加到.gitignore。

但是它仍在尝试添加它。我需要做些什么才能使其正常工作吗?

1 个答案:

答案 0 :(得分:1)

它可能仍被添加到您的git repo中,因此您需要使用以下命令将其删除:

git rm --cached path/to/giant_file
# Stage your giant file for removal from the git repo

使用--amend提交此更改

git commit --amend -CHEAD
# Amend the previous commit with your change

最后,您可以像往常一样推动!

git push
# Push your smaller commit