gerrit-intellij-plugin icon indicating copy to clipboard operation
gerrit-intellij-plugin copied to clipboard

Cannot Push to HEAD

Open lssilva opened this issue 9 years ago • 21 comments

I could not find a way to push to HEAD:refs/for/master it only offers the option to push to :refs/for/master

lssilva avatar May 29 '15 09:05 lssilva

@lssilva: Why do you need this option? Does :refs/for/master not work for you?

uwolfer avatar May 30 '15 09:05 uwolfer

@uwolfer, I'm getting the 'Push Rejected' message for the reason mentioned by @lssilva, so it forces me to use the git bash for 'push origin HEAD:refs/for/master'.

Suavac avatar Jul 02 '15 15:07 Suavac

Can you please provide the full (anonymized) error which you can find in IntelliJ "Version Control"-tab log?

uwolfer avatar Aug 21 '15 10:08 uwolfer

@Suavac / @lssilva: Please see my question above. Any feedback would be appreciated. Thanks.

uwolfer avatar Oct 12 '15 18:10 uwolfer

only refs won't work for my current project I need to push git push origin HEAD:refs/for/rel-2.3.X git push origin HEAD:refs/for/rmaster

That is just how the project is setup and I have no access to change it.

lssilva avatar Oct 14 '15 12:10 lssilva

@lssilva: Can you please provide the full (anonymized) error which you can find in IntelliJ "Version Control"-tab log?

uwolfer avatar Oct 14 '15 17:10 uwolfer

I don't think there is a error it is just not possible to add HEAD anywhere

lssilva avatar Oct 14 '15 18:10 lssilva

@lssilva: Ah, I thought you get the same error as @Suavac when you try to push to refs/for/... (without HEAD).

uwolfer avatar Oct 14 '15 18:10 uwolfer

http://stackoverflow.com/questions/10461214/why-is-git-push-gerrit-headrefs-for-master-used-instead-of-git-push-origin-mast A more detailed discussion here

lssilva avatar Oct 14 '15 21:10 lssilva

@lssilva: Sure, "refs/for/.." is required in order to push to Gerrit. I'm just not sure why "HEAD" is absolutely required in your case.

uwolfer avatar Oct 15 '15 05:10 uwolfer

@Suavac: Can you please provide the full (anonymized) error which you can find in IntelliJ "Version Control"-tab "log" when you get the "push rejected" error?

uwolfer avatar Nov 11 '15 19:11 uwolfer

@uwolfer I just tried to do it to get you a log. In the git push view I replaced master with my URL

HEAD:refs/for/master and I got a pop-up Invalid destination branch name: HEAD:refs/for/master I have a screenshot but cannot attach here.

On command line I use

git push origin HEAD:refs/for/master

Seems the validation in the plugin is not accurate.

lssilva avatar Nov 16 '15 13:11 lssilva

@lssilva: You can attach screenshots here - just drag it into the comment field.

uwolfer avatar Nov 16 '15 16:11 uwolfer

screen shot 2015-11-16 at 14 03 18

lssilva avatar Nov 17 '15 08:11 lssilva

@lssilva: What version of IntelliJ are you using?

Do you have enabled the option "Push to Gerrit" in the push dialog? When exactly does this message pop up?

uwolfer avatar Nov 17 '15 18:11 uwolfer

I see same issue. All I can see in IntelliJ log is - 2:43:29 PM Push rejected: Push to origin/refs/for/master was rejected

I"m using Gerrit 2.12.2 and Plugin version 0.9.8.1-142. As stated in this thread, I can push the changes to gerrit for review as git push origin HEAD:refs/for/master

nsharma-git avatar Jun 14 '16 09:06 nsharma-git

I'm having the same issue with Gerrit 2.12 and Plugin version 0.9.9.1-142.

@uwolfer I found out that I'm getting this error initially for the lack of change-id in my commits. Is there a way for the plugin to add change id by automatically adding the hook and amending commits? (asking because git review CLI tool is able to that)

After manually adding the change id, it worked for me.

tunix avatar Oct 31 '16 14:10 tunix

@tunix: No, it is not possible to add change ids after committing automatically with the plugin. If you'd like this feature, you can open a feature request for it.

uwolfer avatar Oct 31 '16 17:10 uwolfer

Same thing with me. I want to add HEAD as HEAD:refs/for/"Branch Name", but it doesn't allow me to add and I can not push my commit image

dadpem avatar Mar 09 '17 09:03 dadpem

Hi, please somebody explain me how to use this plugin properly. I have a Linux machine with installed Gerrit on it and i want to manage my code review from Intelij IDE, which runs on the local Windows machine. I have already gerrit plugin installed on my intelij and i connected to gerrit server, but when i'm pushing the commits with gerrit options, the commits are never getting the gerrit server, despite i'm getting sometimes the message "pushed successfully". What is wrong?

Etesyolk avatar Oct 31 '17 04:10 Etesyolk

@Etesyolk: You can see details about your push in Version Control -> Log tool window. If this still does not help, please open a new issue here on GitHub.

uwolfer avatar Oct 31 '17 18:10 uwolfer