Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = not valid ref |
Edwin Kempin | b4830d2 | 2011-01-11 09:36:18 +0100 | [diff] [blame] | 2 | |
| 3 | With this error message Gerrit rejects to push a commit if the target |
| 4 | ref in the push specification has an incorrect format (for example: |
| 5 | '/refs/for/master', 'refs/for//master'). |
| 6 | |
| 7 | To solve the problem you have to correct the target ref in the push |
| 8 | specification. Depending on whether you want to push your commit with |
| 9 | or without code review the ref format is different: |
| 10 | |
| 11 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 12 | == ref format for pushing a commit for code review: |
Edwin Kempin | b4830d2 | 2011-01-11 09:36:18 +0100 | [diff] [blame] | 13 | |
| 14 | If it was the intention to push a commit for code review the target |
| 15 | ref in the push specification must be the project's magical ref |
| 16 | `refs/for/'branch'` (where 'branch' must be replaced with the name |
| 17 | of an existing branch to which you want to push your commit). Further |
| 18 | details about how to push a commit for code review are explained at |
| 19 | link:user-upload.html#push_create[Create Changes]). |
| 20 | |
| 21 | Example for pushing a commit for code review to the 'master' branch: |
| 22 | ---- |
| 23 | $ git push ssh://JohnDoe@host:29418/myProject HEAD:refs/for/master |
| 24 | ---- |
| 25 | |
| 26 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 27 | == ref format for directly pushing a commit (without code review): |
Edwin Kempin | b4830d2 | 2011-01-11 09:36:18 +0100 | [diff] [blame] | 28 | |
| 29 | If it was the intention to bypass code review and to push directly to |
| 30 | a branch the target ref in the push specification must be the name of |
| 31 | the branch to which you want to push. Further details about how to |
| 32 | bypass code review are explained at link:user-upload.html#bypass_review[Bypass Review]. |
| 33 | |
| 34 | Example for pushing a commit directly to the 'master' branch (without |
| 35 | code review): |
| 36 | ---- |
| 37 | $ git push ssh://JohnDoe@host:29418/myProject HEAD:master |
| 38 | ---- |
| 39 | |
| 40 | |
| 41 | GERRIT |
| 42 | ------ |
| 43 | Part of link:error-messages.html[Gerrit Error Messages] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 44 | |
| 45 | SEARCHBOX |
| 46 | --------- |