我分散了许多相关的代码,我决定将其整合到一个github仓库中。我不小心提交,推送,移动和删除了较大的文件(大于50MB)。我对git不太熟悉,所以做了很多事情,比如使用mv / rm而不是git mv / rm。我追溯地试图纠正这个问题,但我不确定我是否只是把事情弄糊涂了。
因为在我尝试推动时所做的一切,我得到:
-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
但这似乎没有帮助。
为了让您了解我所做的回购/文件大小:
-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'
答案 0 :(得分:3)
最后一件事是计算机已经老了,没有太多内存。这可能是个问题吗?
是。 signal 9
意味着你的打包过程(构建一个发送给GitHub的瘦包)已被" OOM杀手"杀死。另请参阅Git out of memory and then fatal - early EOF(这是服务器内存不足的情况,因此有点不同)。
您可以尝试使用您身边的包装参数:
core.packedGitWindowSize
core.packedGitLimit
pack.window
pack.depth
pack.windowMemory
pack.deltaCacheSize
pack.threads
(不是特别与内存相关,但更多线程=需要更多RAM)但最好的办法是给你的机器更多的内存(真正的内存,交换/调页空间,或两者兼而有之)。
答案 1 :(得分:1)
这为我解决了
git reset origin/branchName
git add -a
、git commit -m "commit message"
git push