git 如何将草稿推送到 Gerrit?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18106064/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to push Drafts to Gerrit?
提问by Bobby
I am unable to push the Drafts to gerrit. When I try to push drafts to gerrit it is throwing the following error.
我无法将草案推送到 gerrit。当我尝试将草稿推送到 gerrit 时,它会引发以下错误。
[3:37pm] [myrepo] -> git push origin HEAD:refs/drafts/remote Counting objects: 167, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (80/80), done.
Writing objects: 100% (124/124), 58.19 KiB, done.
Total 124 (delta 75), reused 47 (delta 32)
remote: Resolving deltas: 34% (26/75)
To ssh://myrepo ! [remote rejected] HEAD -> refs/drafts/remote(prohibited by Gerrit)
error: failed to push some refs to 'ssh://myrepo'
[3:37pm] [myrepo] -> git push origin HEAD:refs/drafts/remote 计数对象:167,完成。
使用多达 8 个线程的增量压缩。
压缩对象:100% (80/80),完成。
写入对象:100% (124/124),58.19 KiB,完成。
总计 124(增量 75),重复使用 47(增量 32)
远程:解决增量:34% (26/75)
到 ssh://myrepo ![远程拒绝] HEAD -> refs/drafts/remote(Gerrit 禁止)
错误:未能将一些引用推送到“ssh://myrepo”
Can some one help me out in this issue?
有人可以帮我解决这个问题吗?
回答by elhadi dp ?p????
use this command:
使用这个命令:
git push --receive-pack="git receive-pack" origin {commit SHA-1 or HEAD}:refs/drafts/{branch}
A general rule to push into gerrit, branch = master:
推入 gerrit 的一般规则,branch = master:
git push origin <a_local_branch_name or specific_commit or HEAD>:refs/for/master
A general rule to push into gerrit as DRAFT, branch = master:
将 gerrit 作为 DRAFT,branch = master 推入的一般规则:
git push origin <a_local_branch_name or specific_commit or HEAD>:refs/drafts/master