git - git push 是慢了还是出了什么问题?

标签 git github push

我有很多相关的代码分散在周围,我决定将它们整合到一个 github 存储库中。我不小心提交、推送、移动和删除了较大的文件(大于 50MB)。我对 git 不是很有经验,所以做了很多事情,比如使用 mv/rm 而不是 git mv/rm。我回顾性地尝试纠正这个问题,但不确定我是否只是混淆了事情。

因为在我尝试 push 时做了所有这些,所以我得到:

-bash-4.1$ git push
Counting objects: 1288, done.
Delta compression using up to 8 threads.
Connection to github.com closed by remote host.
fatal: The remote end hung up unexpectedly
compressing objects:  87% (1060/1211)

但它似乎只是卡在那里。有没有办法判断是否存在问题,或者我是否只需要等待更长的时间?

我尝试通过以下方式增加帖子缓冲区:

-bash-4.1$ git config --global http.postBuffer 157286400

但这似乎没有帮助。

为了让您了解我所做的 repo /文件大小:

-bash-4.1$ du -sh *
126M    mg
4.0K    readme.md

-bash-4.1$ find ./ -type f -size +50M -exec ls -lh {} \;
-r--r--r-- 1 oc13378 emat13r 55M Oct 25 18:48 ./.git/objects/a6/c86199d33fac72d856d3381fe07239d7089b80
-r--r--r-- 1 oc13378 emat13r 65M Oct 25 19:00 ./.git/objects/d6/c82684b7db5939dbec6193d9a16b9b0954740c
-r--r--r-- 1 oc13378 emat13r 56M Oct 25 18:57 ./.git/objects/bd/0a85627a6fe53e0322ebf33c70d1ad1f26642b
-r--r--r-- 1 oc13378 emat13r 67M Oct 25 18:56 ./.git/objects/63/4209365d534cc6dd7d081c949b123df8052bd0
-r--r--r-- 1 oc13378 emat13r 60M Oct 25 18:55 ./.git/objects/2b/25a30d92e48a72e32d7062a4c5ffc5734fec94
-r--r--r-- 1 oc13378 emat13r 58M Oct 25 18:46 ./.git/objects/50/5495be51d3d8bd98b0c67a3ed41859fc92153f
-r--r--r-- 1 oc13378 emat13r 58M Oct 25 19:03 ./.git/objects/38/99700d5472df9442e118c82dd8fe9ee336bc5b
-r--r--r-- 1 oc13378 emat13r 52M Oct 25 18:44 ./.git/objects/b4/42ac818898e285c524e9300ecfa46ca53a2c3c
-r--r--r-- 1 oc13378 emat13r 54M Oct 25 19:00 ./.git/objects/4f/386fbc1389074f548a70a7a6f6e65df1a57710
-r--r--r-- 1 oc13378 emat13r 53M Oct 25 18:55 ./.git/objects/37/c25b249642f200c8e5c427d1c6d9b57c5ed089
-r--r--r-- 1 oc13378 emat13r 51M Oct 25 18:37 ./.git/objects/e9/54a09381e8e9a452a672886536718f73587e31
-r--r--r-- 1 oc13378 emat13r 52M Oct 25 18:37 ./.git/objects/b2/3ab90e379e2647c0bb9ccfdc6346b2c3d8df8f
-r--r--r-- 1 oc13378 emat13r 57M Oct 25 18:59 ./.git/objects/ac/ca72cfb9a4537828fd747b0a05ec0a79efdc65
-r--r--r-- 1 oc13378 emat13r 55M Oct 25 18:47 ./.git/objects/2e/da077ed31886e677dcb2b4bc6b1abe340527b6
-r--r--r-- 1 oc13378 emat13r 56M Oct 25 18:41 ./.git/objects/2e/d7ea9d06803d85ce9504c69619c516c2bac928
-r--r--r-- 1 oc13378 emat13r 51M Oct 25 18:45 ./.git/objects/04/b1e3fdcf9bc74c696f77c3b7d5f0d2fa5be992
-r--r--r-- 1 oc13378 emat13r 59M Oct 25 18:57 ./.git/objects/d5/355a991c4812379649e94123feb518160cc6cb
-r--r--r-- 1 oc13378 emat13r 53M Oct 25 18:56 ./.git/objects/ec/93271bb4b898438b2c90b7048a26f8dc54b553
-r--r--r-- 1 oc13378 emat13r 63M Oct 25 18:47 ./.git/objects/85/e33df7c1882788b12ee866d8c38427bd22aa44
-r--r--r-- 1 oc13378 emat13r 55M Oct 25 18:48 ./.git/objects/ce/70d6d87e7d810c570da3e2e534213653c05de6
-r--r--r-- 1 oc13378 emat13r 57M Oct 25 18:37 ./.git/objects/7a/abe86d346247dceadb0324696a044331f56440
-r--r--r-- 1 oc13378 emat13r 51M Oct 25 18:46 ./.git/objects/2a/d85020500a36387d60046c9e5ddf500aa44286
-r--r--r-- 1 oc13378 emat13r 59M Oct 25 18:59 ./.git/objects/fb/6928f2f569361935db50d4f0ed8ece5feaf6f1
-r--r--r-- 1 oc13378 emat13r 54M Oct 25 19:01 ./.git/objects/c6/c2843b3b40bf6c6b7b6f974f004009b8e45e4e
-r--r--r-- 1 oc13378 emat13r 56M Oct 25 18:47 ./.git/objects/fe/0b521c082fb0290bb011c73daba372b4805db4
-r--r--r-- 1 oc13378 emat13r 61M Oct 25 19:02 ./.git/objects/5a/373c53b589d429eff09e1d2a18d9b7f85658cf
-r--r--r-- 1 oc13378 emat13r 53M Oct 25 18:37 ./.git/objects/bb/e662205d31a9ccbd2d755fc46f99aae4bd0fe2
-r--r--r-- 1 oc13378 emat13r 51M Oct 25 18:37 ./.git/objects/69/32e59d33eae1e13357d0e048dee3f77b97ba72

最后一件事是电脑很旧而且内存不足。这可能是个问题吗?

-bash-4.1$ free
              total       used       free     shared    buffers     cached
Mem:       8059876    1112512    6947364          0       6372     927848
-/+ buffers/cache:     178292    7881584
Swap:      4194300      31156    4163144
-bash-4.1$ free -m
              total       used       free     shared    buffers     cached
Mem:          7870       1086       6784          0          6        906
-/+ buffers/cache:        174       7696
Swap:         4095         30       4065

我最近的尝试以失败告终:

-bash-4.1$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 5 commits.
#
nothing to commit (working directory clean)
-bash-4.1$ git push
Counting objects: 1288, done.
Delta compression using up to 8 threads.
Connection to github.com closed by remote host.
fatal: The remote end hung up unexpectedly
error: pack-objects died of signal 9)   
error: pack-objects died with strange error
error: failed to push some refs to 'git@git-uni:OliCUoB/wc.git'

最佳答案

One last things is that the computer is old and doesn't have much RAM. Could this be a problem?

是的。 信号 9 表示您的打包进程(构建一个精简包以发送到 GitHub)已被“OOM killer ”杀死。另见 Git out of memory and then fatal - early EOF (这是 服务器 内存不足的情况,因此有点不同)。

你可以尝试在你这边的包装参数上大惊小怪:

  • core.packedGitWindowSize
  • core.packedGitLimit
  • pack.window
  • pack.depth
  • pack.windowMemory
  • pack.deltaCacheSize
  • pack.threads(与内存无关,但更多线程 = 需要更多 RAM)

但您最好的选择是为您的机器提供更多内存(实际 RAM、交换/分页空间,或两者)。

关于git - git push 是慢了还是出了什么问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40346413/

相关文章:

Git 正在丢失单个文件的历史记录/内容

Git shell 在 OpenSSH pop 窗口中提示输入密码

git - 有没有办法避免在使用 HTTPS 进行 git 推送时输入用户名?

c++ - 如何从 C Microsoft PC 应用程序向 iPhone 发送 APNS 推送通知?

git - 如何使用 git

git - 将远程 github 存储库中的更改 merge 到本地存储库

Git 智能 merge

git - 保护git存储库中的文件

ios - 自定义按钮回推

web-services - 使用生产代码部署配置文件