Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to push Drafts to Gerrit?

Tags:

git

gerrit

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?

like image 665
Bobby Avatar asked Aug 07 '13 14:08

Bobby


People also ask

How do you push codes for reviews?

You need to add a Change-Id line to your commit and then re-execute the "push" command. To add the Change-Id automatically you need to have the "commit-msg" hook installed on your local repository.


1 Answers

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 
like image 151
elhadi dp ıpɐɥןǝ Avatar answered Sep 22 '22 20:09

elhadi dp ıpɐɥןǝ