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?
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With