28

I am unable to push the Drafts to gerrit. When I try to push drafts to gerrit it is throwing the following error.

[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'

Can some one help me out in this issue?

1
  • 1
    Thomas Mtthews:In simple terms,Gerrit is an Web based tool where you can push your code changes so that other team members will review the changes and approve or reject if any errors are there.
    – Bobby
    Commented Aug 14, 2013 at 11:54

1 Answer 1

49

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:

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:

git push origin <a_local_branch_name or specific_commit or HEAD>:refs/drafts/master
6
  • But I am getting this error when I run the above mentioned command. esekilxxen1503 [10:47am] -> git push --receive-pack="git receive-pack" origin HEAD:refs/drafts/branch Total 0 (delta 0), reused 0 (delta 0) To ssh://[email protected]:29418/branch ! [remote rejected] HEAD -> refs/drafts/com_33_rel (prohibited by Gerrit) error: failed to push some refs to 'ssh://[email protected]:29418/
    – Bobby
    Commented Oct 18, 2013 at 8:52
  • git push --receive-pack="git receive-pack" origin HEAD:refs/drafts/branch
    – Bobby
    Commented Nov 1, 2013 at 9:57
  • Have you a branch named "branch"? you want to push as draft to which branch if no? Commented Nov 4, 2013 at 9:59
  • 1
    Thanks for the reply elhadi :) Yes,I have a branch with the name as "branch" and i am pushing to that.
    – Bobby
    Commented Nov 5, 2013 at 16:30
  • so try: "git fetch"; then "git push origin <your local branch or HEAD>:refs/drafts/branch" Commented Nov 6, 2013 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.