尝试上传大文件后无法推送到github repo

时间:2018-12-10 18:53:55

标签: git github git-push

我试图上传一个大于100 mb的文件,而github拒绝了我。从那以后,我从本地存储库中删除了该文件,再次执行了常规的git add - commit - push仪式,但是我一直得到这个输出

Counting objects: 127, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (124/124), done.
Writing objects: 100% (127/127), 108.16 MiB | 3.95 MiB/s, done.
Total 127 (delta 12), reused 1 (delta 0)
remote: Resolving deltas: 100% (12/12), done.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: TRACENUMBER
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File data/myfile.csv is 678.14 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/REPO_URL
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/REPO_URL'

好像文件仍在我的本地仓库中。 git status说:

On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

但是我当然不能推任何东西。 有关信息,存储库是私有的,我可以推送(而且我一直这样做),但我不是所有者。

1 个答案:

答案 0 :(得分:0)

您可能已将其从存储库中删除,但是文件(显然)仍隐藏在您要推送的 some 提交中。 git rm不能解决问题:您必须rebase(或merge --squash进入新分支)才能摆脱包含该文件的提交。