github:无法从提交中删除大文件

时间:2019-10-28 18:20:40

标签: git github large-files

我试图将提交提交到我的Github存储库-它说其中的文件太大。

(base) Martys-MacBook-Pro-2:triplets martyjiffar$ git push
Enter passphrase for key '/Users/martyjiffar/.ssh/id_rsa': 
Enumerating objects: 306, done.
Counting objects: 100% (306/306), done.
Delta compression using up to 8 threads
Compressing objects: 100% (288/288), done.
Writing objects: 100% (289/289), 11.54 MiB | 667.00 KiB/s, done.
Total 289 (delta 241), reused 0 (delta 0)
remote: Resolving deltas: 100% (241/241), completed with 13 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: 8b7f2e5b820a21e50608b9b3fcda7bfd
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File data_analysis/Graphs/sub3_pairwise_sim.eps is 119.54 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File data_analysis/Graphs/sub4_pairwise_sim.eps is 119.54 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File data_analysis/Graphs/sub1_pairwise_sim.eps is 119.54 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File data_analysis/Graphs/sub2_pairwise_sim.eps is 119.54 MB; this exceeds GitHub's file size limit of 100.00 MB
To github.com:marty-jiffar/triplets.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@github.com:marty-jiffar/triplets.git'

然后我使用git rm尝试从提交中删除那些文件,就像我在网上找到的一样:

(base) Martys-MacBook-Pro-2:triplets martyjiffar$ git rm sub2_pairwise_sim.eps
fatal: pathspec 'sub2_pairwise_sim.eps' did not match any files
(base) Martys-MacBook-Pro-2:triplets martyjiffar$ git rm data_analysis/Graphs/sub2_pairwise_sim.eps
rm 'data_analysis/Graphs/sub2_pairwise_sim.eps'
(base) Martys-MacBook-Pro-2:triplets martyjiffar$ git rm data_analysis/Graphs/sub1_pairwise_sim.eps
rm 'data_analysis/Graphs/sub1_pairwise_sim.eps'
(base) Martys-MacBook-Pro-2:triplets martyjiffar$ git rm data_analysis/Graphs/sub3_pairwise_sim.eps
rm 'data_analysis/Graphs/sub3_pairwise_sim.eps'
(base) Martys-MacBook-Pro-2:triplets martyjiffar$ git rm data_analysis/Graphs/sub4_pairwise_sim.eps
rm 'data_analysis/Graphs/sub4_pairwise_sim.eps'
(base) Martys-MacBook-Pro-2:triplets martyjiffar$ git status
On branch master
Your branch is ahead of 'origin/master' by 6 commits.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    deleted:    data_analysis/Graphs/sub1_pairwise_sim.eps
    deleted:    data_analysis/Graphs/sub2_pairwise_sim.eps
    deleted:    data_analysis/Graphs/sub3_pairwise_sim.eps
    deleted:    data_analysis/Graphs/sub4_pairwise_sim.eps

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   data_analysis/analysis.py

(base) Martys-MacBook-Pro-2:triplets martyjiffar$ git commit --amend -CHEAD
[master 482d4a0] Revert "made html page for 0% correct, 25% correct, etc triplet examples"
 Date: Mon Oct 28 12:51:40 2019 -0500
 1 file changed, 1 insertion(+)
 create mode 100644 data_analysis/Graphs/.gitattributes

当我尝试再次推动时,它仍然无法正常工作。

(base) Martys-MacBook-Pro-2:triplets martyjiffar$ git push
Enter passphrase for key '/Users/martyjiffar/.ssh/id_rsa': 
Enumerating objects: 302, done.
Counting objects: 100% (302/302), done.
Delta compression using up to 8 threads
Compressing objects: 100% (284/284), done.
Writing objects: 100% (285/285), 11.54 MiB | 673.00 KiB/s, done.
Total 285 (delta 242), reused 0 (delta 0)
remote: Resolving deltas: 100% (242/242), completed with 13 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: 5fa197506e184d5b6728391c976f8542
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File data_analysis/Graphs/sub3_pairwise_sim.eps is 119.54 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File data_analysis/Graphs/sub4_pairwise_sim.eps is 119.54 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File data_analysis/Graphs/sub1_pairwise_sim.eps is 119.54 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File data_analysis/Graphs/sub2_pairwise_sim.eps is 119.54 MB; this exceeds GitHub's file size limit of 100.00 MB
To github.com:marty-jiffar/triplets.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@github.com:marty-jiffar/triplets.git'
(base) Martys-MacBook-Pro-2:triplets martyjiffar$ 

在这一点上,我已经尝试了很多事情,甚至尝试安装大型文件存储(即使我不需要保留这些文件,我只是想将其余的更新都已经推送),但是也不行。任何帮助将不胜感激。

如果有帮助的话,Mac OS,并且我不需要将这些文件保留在本地计算机上,完全可以删除它们。谢谢。

0 个答案:

没有答案