您可能会引用用户when pushing new commits 使用的魔术引用refs/for/<branch ref>。
要创建新的更改以供审核,只需使用任何 Git 客户端工具推送到项目的神奇refs/for/'branch' ref:
git push ssh://sshusername@hostname:29418/projectname HEAD:refs/for/branch
例如john.doe 可以使用 git push 为项目kernel/common 的experimental 分支上传新的更改,托管在git.example.com Gerrit 服务器上:
git push ssh://john.doe@git.example.com:29418/kernel/common HEAD:refs/for/experimental
git push 客户端上传的每一个新提交都会在服务器上转换成一条变更记录。
远程引用 refs/for/experimental 实际上并不是由 Gerrit 创建的,即使客户端的状态消息可能另有说明。
从技术上讲,这是由cmd-receive-pack 管理的。
由“git push”调用并更新项目的存储库
从 'git push' 端提供的信息。
它由 gerrit/sshd/commands/Receive.java 实现,它使用 Git receive-pack protocol 通过 SSH 接收更改上传。