2
我一直在尝试对git push
使用相对较新的--atomic
选项,但它并不适用于我,也就是说,即使其他人失败,它仍然会让一些裁判改变。git push --atomic - Not failing
从差异here看来,在接受原子标记的远程服务器上也需要有一些东西。虽然这是有道理的,但似乎默认是使用它。
我使用http协议推送到BitBucket服务器实例。服务器上当前版本的Git是“git version 2.8.1”。
有什么我需要在服务器上配置,使其工作?
编辑:
下面是可再现的例子。
配置的服务器:
$ git --version
git version 2.8.1
$ git config --get-all --show-origin receive.advertiseatomic
file:/home/bitbucket/.gitconfig 1
在客户端:
$ git --version
git version 2.8.2.windows.1
$ git push <local-path>/.git HEAD:refs/heads/wwww HEAD:refs/heads/zzz --force-with-lease=zzz --atomic
error: atomic push failed for ref refs/heads/zzz. status: 7
fatal: The remote end hung up unexpectedly
To <local-path>/.git
! [rejected] HEAD -> wwww (atomic push failed)
! [rejected] HEAD -> zzz (stale info)
error: failed to push some refs to '<local-path>/.git'
$ git push origin HEAD:refs/heads/wwww HEAD:refs/heads/zzz --force-with-lease=zzz --atomic
Total 0 (delta 0), reused 0 (delta 0)
remote:
remote:
To http://[email protected]/scm/proj/repo.git
* [new branch] HEAD -> wwww
! [rejected] HEAD -> zzz (stale info)
error: failed to push some refs to 'http://[email protected]/scm/proj/repo.git'
我不是说它被推送到BitBucket云服务器。它被推送到运行BitBucket的私人服务器,我是管理员。我更新了服务器以使用2.8.1,并且在远程存储库上没有为'receive.advertiseatomic'配置任何内容。我想知道它是否与HTTP协议有关,在这种情况下,它可能不会接受--atomic选项。客户端也不会失败,并让我知道远程无法处理原子。 –
@ JosephK.Strauss它应该在http上工作。你尝试了一个明确的'git config receive.advertiseatomic 1'(尽管它应该是默认的)。你有可复制的情况吗? – VonC