Help us understand the problem. What is going on with this article?

gitbucketにpushするときにエラーが発生する

More than 5 years have passed since last update.

Environment

  • gitbucket version: 3.6
  • local git version: 2.4.3

Problem

gitbucketにpushするときに以下のエラーが発生した

$ git push
Counting objects: 42, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (41/41), done.
Writing objects: 100% (42/42), 28.99 KiB | 0 bytes/s, done.
Total 42 (delta 24), reused 0 (delta 0)
remote: error: Internal server error
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'http://xxx.git'

gitbucketのログには以下のようなエラーが表示されていた

# /var/log/upstart/gitbucket.log

2015-11-09 15:57:38.451:WARN:/:Internal error during receive-pack
org.eclipse.jgit.errors.PackProtocolException: error: invalid protocol: wanted 'old new ref'
    at org.eclipse.jgit.transport.BaseReceivePack.recvCommands(BaseReceivePack.java:935)
    at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:184)
    at org.eclipse.jgit.transport.ReceivePack.receive(ReceivePack.java:160)
    at org.eclipse.jgit.http.server.ReceivePackServlet.doPost(ReceivePackServlet.java:187)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

Solution

参考: http://stackoverflow.com/questions/21557004/protocol-error-expected-old-new-ref-got-shallow-deeb

unshallowした後にpushすると成功した

$ git fetch --unshallow
$ git push
k-yamada-github
Kotlin, Swift, Android, iOS, Vue.js, AWS
sonix
Mobility Tech Company「世界」をリードするイノベータ集団でありたい
https://www.sonix.asia/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away