【发布时间】:2020-08-11 04:47:36
【问题描述】:
我有一个想要推送到新网址的现有仓库。我尝试了以下方法。
$ git remote set-url origin git@github.com:user/new-repo.git
$ git config --global http.postBuffer 1048576000
$ git config --global ssh.postBuffer 1048576000
$ git push --verbose
Pushing to github.com:user/new-repo.git
Enumerating objects: 2729, done.
Counting objects: 100% (2729/2729), done.
Delta compression using up to 24 threads
fatal: the remote end hung up unexpectedly
Connection to github.com closed by remote host.
error: pack-objects died of signal 2)
fatal: the remote end hung up unexpectedly
$ git repack
Enumerating objects: 2999, done.
Counting objects: 100% (2732/2732), done.
Delta compression using up to 24 threads
Compressing objects: 100% (2548/2548), done.
Writing objects: 100% (2732/2732), done.
Total 2732 (delta 1716), reused 0 (delta 0), pack-reused 0
$ git push --verbose
Pushing to github.com:user/new-repo.git
Enumerating objects: 2729, done.
Counting objects: 100% (2729/2729), done.
Delta compression using up to 24 threads
Compressing objects: 100% (1115/1115), 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:user/new-repo.git
! [remote rejected] master -> master (failed)
error: failed to push some refs to 'github.com:user/new-repo.git'
在单独的 repo 副本中:
$ git remote set-url origin https://github.com/user/new-repo.git
$ git remote -v
origin https://github.com/user/new-repo.git (fetch)
origin https://github.com/user/new-repo.git (push)
$ git push
Enumerating objects: 2729, done.
Counting objects: 100% (2729/2729), done.
Delta compression using up to 24 threads
Compressing objects: 100% (2106/2106), done.
Writing objects: 100% (2729/2729), 2.50 GiB | 3.01 MiB/s, done.
Total 2729 (delta 1723), reused 706 (delta 395), pack-reused 0
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date
原始 repo 托管在 gitlab 上。使用 github 的导入功能也会失败,没有描述性消息。 Gitlab 显示 repo 为 3.7GB,并且没有非常大的单个文件。
任何调试想法?谢谢。
【问题讨论】: