Gerrit: remote rejected (you are not allowed to upload merges) even though I allowed “Push merge commit”

被刻印的时光 ゝ 提交于 2019-11-30 03:09:26

问题


I've configured Gerrit to allow Push Merge Commit on my branch, but I still get the following error when I try to push a merge commit:

! [remote rejected] ANDROID-foo -> ANDROID-foo (you are not allowed to upload merges)

I'm running Gerrit 2.8-1-gaa9367b.


回答1:


This is a bug in gerrit. The workaround is to create another reference named refs/for/refs/heads/<BRANCH_NAME>, and allow Push Merge Commit on it.

To be more specifically, add following lines in your project.config file

[access "refs/for/refs/*"]
  pushMerge = group <your-id-here>



回答2:


Workaround which was more suitable for me as it doesn't involve knowing branches is to allow Push Merge Commit to refs/for/refs/heads/*. You probably won't want to be doing changing these for every branch specifically.




回答3:


It worked for me by this way(after this link):

  1. git stash
  2. git pull --rebase
  3. git push
  4. git pull
  5. git stash pop


来源:https://stackoverflow.com/questions/21199817/gerrit-remote-rejected-you-are-not-allowed-to-upload-merges-even-though-i-all

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!