【发布时间】:2021-07-09 01:52:27
【问题描述】:
我有一个项目。一位客户希望将她的 prestashop 网站上传到 github。
我开始一次添加和提交一个文件夹。在某个时刻,github 开始返回错误。
您将如何解决将包含数千个(如果不是数万个)文件的网站上传到 github 的问题?
我有 Windows。
编辑:
你好。我添加了一些文件。我一点一点地补充。然后发生的事情是我变得贪婪并且一次添加了太多文件。现在,无论我尝试什么,我都会不断收到此错误。我该如何解决这个问题?
$ git push
Enter passphrase for key '/c/Users/guestaccount/.ssh/id_rsa':
Enumerating objects: 35931, done.
Counting objects: 100% (35931/35931), done.
Delta compression using up to 12 threads
Compressing objects: 100% (35856/35856), done.
remote: fatal: pack exceeds maximum allowed size
fatal: sha1 file '<stdout>' write error: Broken pipe
error: remote unpack failed: index-pack abnormal exit
To github.com:(mygithubid)/(repo).git
! [remote rejected] main -> main (failed)
error: failed to push some refs to 'github.com:(mygithubid)/(repo).git'
我正在使用 Visual Studio Code 和 git bash 上传。
【问题讨论】:
-
既然这似乎是一个商业企业,获得(付费)GitHub支持并使用GitHub支持...? (另外:如果你在 GitHub 而不是 GitLab 上,为什么用 gitlab 标记它?)
-
我们需要知道错误才能提供帮助,但我有一个猜测。 Git 和 Github 处理数以万计的文件没有问题,您可以而且应该在最初的“将现有项目导入 Git”提交中一次性添加它们(git add .)。尽管您需要确保没有上传任何客户信息或机密。它确实有一个问题是非常大的文件。见Working with large files 和Versioning large files。
-
我已经澄清了我的问题。错误发布在上面。感谢您提供帮助。
-
见Git - pack exceeds maximum allowed size,它又链接到Github remote push pack size exceeded。但是请注意,除非您在那里获得付费帐户,否则 GitHub 也会对存储库大小进行限制。