Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 文件太大,无法推送_Git_Github_Repository - Fatal编程技术网

Git 文件太大,无法推送

Git 文件太大,无法推送,git,github,repository,Git,Github,Repository,我无法推送,因为文件超过了最大大小。我看到有类似的讨论,但在各种解决方案之后,我没有解决。 下面是git push命令的错误: Counting objects: 249, done. Delta compression using up to 4 threads. Compressing objects: 100% (127/127), done. Writing objects: 100% (130/130), 2.15 MiB | 48.00 KiB/s, done. Total 130

我无法推送,因为文件超过了最大大小。我看到有类似的讨论,但在各种解决方案之后,我没有解决。 下面是git push命令的错误:

Counting objects: 249, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (127/127), done.
Writing objects: 100% (130/130), 2.15 MiB | 48.00 KiB/s, done.
Total 130 (delta 93), reused 1 (delta 0)
remote: Resolving deltas: 100% (93/93), completed with 49 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: 8be5f11b65960921d4f91b11ce867549
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File release/RandomSamples.txt is 112.68 MB; this 
exceeds GitHub's file size limit of 100.00 MB
To HERE ADDRESS REPOSITORY
! [remote rejected] MYBRANCH -> MYBRANCH (pre-receive hook declined)
我能做什么?

正如在回答您的问题时所建议的,以及您需要使用的控制台输出本身所建议的

始终值得考虑是否确实需要在源代码管理中存储对象如果对象太大,可能会有更好的解决方案。如果它是一个二进制依赖项,不会改变,那么有更好的解决方案,比如工件存储库,如果它是项目的构建工件,您真的应该在源代码管理中分发它吗?

我这样解决: 我想推,但我不能,因为有一个文件太大了。那么我想做:

git add -A .
git commit -m "Remove deleted files"
git push
删除这个太大的文件。但我不能,因为有这么大的文件。与

git status
我看到我比我的远程存储库提前了3次提交。因此,我做到了:

git reset HEAD^
git reset HEAD^
git reset HEAD^
(HEAD^因为我在Unix系统上,否则HEAD-1可能是) 后来又

git add -A .
git commit -m "Remove deleted files"
git push
这一次起作用了,我用wich从远程删除了这个该死的文件


这就是全部

试试看。我从区域设置中删除了这个大文件。但是这个文件仍然出现在遥控器上。但是我没有必要使用它。因此我不喜欢Git大文件存储抱歉,您的评论不清楚。“但是我没有必要使用它。”你不需要这个文件吗?你不“我的”Git LFS吗?是的,我不关心Git大文件存储,我不需要它是对的。很抱歉