the receiving end does not support push options

跟風遠走 提交于 2020-05-11 04:31:19

问题


At first my server's git version was 2.7.4 and the error was accurate. Afterwards, however, I updated and have confirmed this with git version:

Server

$ git --version  
git version 2.13.0

Client

$ git --version  
git version 2.11.0 (Apple Git-81)

Yet when I try to push this happens:

$ git push --push-option=test  
fatal: the receiving end does not support push options  
fatal: The remote end hung up unexpectedly

Even though according to documentation this should be supported in both the client version and server version:
2.11.0
2.13.0

I even created two new local repositories on each and then tried to push to the other local repository from the other (so it isn't even communicating between a different server) yet I still get that error. Is there something I have to enable? I can't find anything about having to do that on the docs.


回答1:


After searching through code until I found the actual tests for push options I found out you have to enable a specific config for the repository which is conveniently disabled by default: https://git-scm.com/docs/git-config#git-config-receiveadvertisePushOptions

You can enable it with

$ git config receive.advertisePushOptions true

This is also conveniently not referenced anywhere on the actual documentation for git push or even, as far as I can tell, anywhere else at all.



来源:https://stackoverflow.com/questions/45400553/the-receiving-end-does-not-support-push-options

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!