我增加,而錯誤ץ 犯了一個大文件試圖推動遠程I得到大文件沒有得到刪除從提交
git push
Counting objects: 417, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (390/390), done.
Writing objects: 100% (417/417), 104.63 MiB | 315.00 KiB/s, done.
Total 417 (delta 207), reused 0 (delta 0)
remote: Resolving deltas: 100% (207/207), completed with 163 local objects.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com .
remote: error: Trace: *******
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File * is 165.27 MB; this exceeds GitHub's file size limit of 100.00 MB To [email protected]:*** ! [remote rejected] dev -> dev (pre-receive hook declined)
error: failed to push some refs to '[email protected]:****'
我加入gitignore的文件,並從緩存中刪除它時出現錯誤:
git rm -r --cached */*
git add -A
git commit -am
git push
和我得到相同的錯誤。
所以我刪除從我的本地目錄中的文件,還是同樣的錯誤。
我能做些什麼將它從我的提交中刪除? 感謝
請記住,Git會跟蹤項目的歷史。如果您以前提交了大文件,那麼它就在項目的歷史記錄中(即在Git存儲庫中),無論您是否在後續提交中將其刪除。你必須重寫提交你添加大文件的地方(並且根本不要添加它)以擺脫它。 – axiac