Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/28.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
Linux 如何从本地回购中删除大文件以成功推送_Linux_Git_File_Github - Fatal编程技术网

Linux 如何从本地回购中删除大文件以成功推送

Linux 如何从本地回购中删除大文件以成功推送,linux,git,file,github,Linux,Git,File,Github,我刚刚创建了本地repo并提交了根目录中的所有文件。 但由于巨大的文件限制,GiutHub未能接收到推送到远程集线器的请求: [srv50213@cl10-m htdocs]$ git push -u origin master Counting objects: 17875, done. Delta compression using up to 2 threads. Compressing objects: 100% (17645/17645), done. Writing objects:

我刚刚创建了本地repo并提交了根目录中的所有文件。 但由于巨大的文件限制,GiutHub未能接收到推送到远程集线器的请求:

[srv50213@cl10-m htdocs]$ git push -u origin master
Counting objects: 17875, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (17645/17645), done.
Writing objects: 100% (17875/17875), 413.33 MiB | 3.69 MiB/s, done.
Total 17875 (delta 5496), reused 0 (delta 0)
remote: warning: File 20140924.srv50213_tarex.dump is 82.14 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: error: GH001: Large files detected.
remote: error: Trace: ac437f9f600e8418e6bf5065e472204c
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File htdocs/2014-10-09-10:40-site-archive.zip is 227.12 MB; th exceeds GitHub's file size limit of 100 MB
To git@github.com:igorsavinkin/tarex.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@github.com:igorsavinkin/tarex.git'
之后,我尝试从本地回购中删除这些文件,但失败,原因如下:

即使我修正了:

[srv50213@cl10-m ~]$ git commit --amend -CHEAD
[master 35dc27d] remove file1.txt
6 files changed, 1249 insertions(+), 2072 deletions(-)
delete mode 100644 20140924.srv50213_tarex.dump
delete mode 100644 20140924.srv50213_yupe.dump
delete mode 100644 htdocs/2014-10-09-10:40-site-archive.zip
当我想再次推它时,我得到了相同的结果:

[srv50213@cl10-m ~]$ git push -u origin master
Counting objects: 17875, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (17645/17645), done.
Writing objects: 100% (17875/17875), 413.33 MiB | 3.63 MiB/s, done.
Total 17875 (delta 5499), reused 0 (delta 0)
remote: warning: File 20140924.srv50213_tarex.dump is 82.14 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: error: GH001: Large files detected.
remote: error: Trace: 7abab285207c27988ceddd39f61f25cd
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File htdocs/2014-10-09-10:40-site-archive.zip is 227.12 MB; this exceeds GitHub's file size limit of 100 MB
To git@github.com:igorsavinkin/tarex.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@github.com:igorsavinkin/tarex.git'
如何在本地回购中存储/卡住2个大文件来解决这个问题?
当我想通过git rm-cached 2014-10-09-10:40-site-archive.zip将它们从git中删除时,它的实例是否应该位于工作副本的相应文件夹中?

可能与@John Zwinck重复,给定的解决方案对我没有帮助。作为[srv50213@cl10-m~]$git filter branch-index filter'git rm-cached-ignore unmatch htdocs/2014-10-09-10:40-site-archive.zip'HEAD无法用脏工作目录重写分支。我已经开始清除整个本地repo并重新添加:$git clean-f,但在将文件夹重新添加到repo之后,我又遇到了同样的问题,同样的大文件。。。
[srv50213@cl10-m ~]$ git push -u origin master
Counting objects: 17875, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (17645/17645), done.
Writing objects: 100% (17875/17875), 413.33 MiB | 3.63 MiB/s, done.
Total 17875 (delta 5499), reused 0 (delta 0)
remote: warning: File 20140924.srv50213_tarex.dump is 82.14 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: error: GH001: Large files detected.
remote: error: Trace: 7abab285207c27988ceddd39f61f25cd
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File htdocs/2014-10-09-10:40-site-archive.zip is 227.12 MB; this exceeds GitHub's file size limit of 100 MB
To git@github.com:igorsavinkin/tarex.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@github.com:igorsavinkin/tarex.git'