Fro*_*ast 10 git githooks git-post-receive
起初我的服务器的git版本是2.7.4,错误是准确的.然而,之后,我更新并使用git版本确认了这一点:
服务器
$ git --version
git version 2.13.0
Run Code Online (Sandbox Code Playgroud)
客户
$ git --version
git version 2.11.0 (Apple Git-81)
Run Code Online (Sandbox Code Playgroud)
然而,当我试图推动这种情况时:
$ git push --push-option=test
fatal: the receiving end does not support push options
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
即使根据文档,这应该在客户端版本和服务器版本中都受支持:
2.11.0
2.13.0
我甚至在每个上创建了两个新的本地存储库,然后尝试从另一个本地存储库推送到另一个本地存储库(因此它甚至不在另一个服务器之间进行通信)但我仍然遇到了这个错误.有什么我必须启用?我无法找到关于必须在文档上执行此操作的任何内容.
Fro*_*ast 15
在搜索完代码之后,我发现推送选项的实际测试,我发现你必须为存储库启用一个特定的配置,默认情况下可以方便地禁用它:https://git-scm.com/docs/git-config#git -config-receiveadvertisePushOptions
您可以启用它
$ git config receive.advertisePushOptions true
Run Code Online (Sandbox Code Playgroud)
对于实际文档中的任何地方,这也很方便,git push甚至,据我所知,在任何其他地方都没有.