Marian Harbach | ebeb154 | 2019-12-13 10:42:46 +0100 | [diff] [blame] | 1 | :linkattrs: |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2 | = no new changes |
Edwin Kempin | 497ac4a | 2010-12-28 12:55:22 +0100 | [diff] [blame] | 3 | |
| 4 | With this error message Gerrit rejects to push a commit if the pushed |
Bruce Zu | cd6572d | 2014-01-21 11:11:42 +0800 | [diff] [blame] | 5 | commit was already successfully pushed to Gerrit in project scope. |
| 6 | In this case there is no new change and consequently there is nothing |
| 7 | for Gerrit to do. |
Edwin Kempin | 497ac4a | 2010-12-28 12:55:22 +0100 | [diff] [blame] | 8 | |
| 9 | If your push is failing with this error message, you normally |
| 10 | don't have to do anything since the commit was already successfully |
| 11 | pushed. Still this error message may sometimes come as a surprise if |
| 12 | you expected a new commit to be pushed. In this case you should |
| 13 | verify that: |
Edwin Kempin | ddfc41a | 2011-05-06 10:32:05 +0200 | [diff] [blame] | 14 | |
| 15 | . your changes were successfully committed locally (otherwise there |
| 16 | is no new commit which can be pushed) |
| 17 | . you are pushing the correct commit (e.g. if you are pushing HEAD |
| 18 | make sure you have locally checked out the correct branch) |
Edwin Kempin | 497ac4a | 2010-12-28 12:55:22 +0100 | [diff] [blame] | 19 | |
| 20 | If you are sure you are pushing the correct commit and you are still |
| 21 | getting the "no new changes" error unexpectedly you can take the |
| 22 | commit ID and search for the corresponding change in Gerrit. To do |
David Pursehouse | a1d633b | 2014-05-02 17:21:02 +0900 | [diff] [blame] | 23 | this simply paste the commit ID in the Gerrit Web UI into the search |
Edwin Kempin | 497ac4a | 2010-12-28 12:55:22 +0100 | [diff] [blame] | 24 | field. Details about how to search in Gerrit are explained link:user-search.html[here]. |
| 25 | |
Martin Fick | 022280f | 2020-06-02 14:57:03 -0600 | [diff] [blame] | 26 | Please note that generally it only makes sense for each commit to |
| 27 | be pushed only once. This means: |
Edwin Kempin | ddfc41a | 2011-05-06 10:32:05 +0200 | [diff] [blame] | 28 | |
| 29 | . you cannot push a commit again even if the change for which the |
| 30 | commit was pushed before was abandoned (but you may restore the |
| 31 | abandoned change) |
| 32 | . you cannot reset a change to an old patch set by pushing the old |
| 33 | commit for this change again |
| 34 | . if a commit was pushed to one branch you cannot push this commit |
Martin Fick | 022280f | 2020-06-02 14:57:03 -0600 | [diff] [blame] | 35 | to another branch in project scope (see link:user-upload.html#base[exception]). |
Edwin Kempin | ddfc41a | 2011-05-06 10:32:05 +0200 | [diff] [blame] | 36 | . if a commit was pushed directly to a branch (without going through |
| 37 | code review) you cannot push this commit once again for code |
| 38 | review (please note that in this case searching by the commit ID |
Martin Fick | 022280f | 2020-06-02 14:57:03 -0600 | [diff] [blame] | 39 | in the Gerrit Web UI will not find any change), see |
| 40 | link:user-upload.html#base[exception]. |
Edwin Kempin | 497ac4a | 2010-12-28 12:55:22 +0100 | [diff] [blame] | 41 | |
| 42 | If you need to re-push a commit you may rewrite this commit by |
Marco Miller | 82db49e | 2020-06-05 10:57:29 -0400 | [diff] [blame] | 43 | link:http://www.kernel.org/pub/software/scm/git/docs/git-commit.html[amending,role=external,window=_blank] |
Martin Fick | 022280f | 2020-06-02 14:57:03 -0600 | [diff] [blame] | 44 | it or doing an interactive |
Marco Miller | 82db49e | 2020-06-05 10:57:29 -0400 | [diff] [blame] | 45 | link:http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html[git rebase,role=external,window=_blank], |
| 46 | or see link:user-upload.html#base[exception,role=external,window=_blank]. |
| 47 | By rewriting the commit you actually create a new commit |
| 48 | (with a new commit ID in project scope) which can then be pushed to Gerrit. |
David Pursehouse | 905cb4e | 2018-01-26 08:49:52 +0900 | [diff] [blame] | 49 | |
| 50 | If you are pushing the new change to the same destination branch as |
| 51 | the old commit (case 1 above), you also need to replace it with a new |
| 52 | Change-Id, otherwise the push will fail with another error message. |
Edwin Kempin | 497ac4a | 2010-12-28 12:55:22 +0100 | [diff] [blame] | 53 | |
Martin Fick | 022280f | 2020-06-02 14:57:03 -0600 | [diff] [blame] | 54 | Sometimes a change no longer makes sense to be destined for a specific |
| 55 | branch, and instead of trying to re-push the commit for a different |
| 56 | branch, it makes more sense to move the change to the preferred branch |
| 57 | (where it will now likely need a rebase). Moving the change instead of |
| 58 | pushing a rebased commit to the preferred branch helps to retain code |
| 59 | review comments and any previous patchsets on the original change. |
| 60 | |
Kenny Ho | 5c309a8 | 2015-10-02 10:45:02 -0400 | [diff] [blame] | 61 | == Fast-forward merges |
| 62 | |
| 63 | You will also encounter this error if you did a Fast-forward merge |
| 64 | and try to push the result. A workaround is to use the |
| 65 | link:user-upload.html#base[Selecting Merge Base] |
| 66 | feature or enable the |
| 67 | link:project-configuration.html#_use_target_branch_when_determining_new_changes_to_open[ |
| 68 | Use target branch when determining new changes to open] |
| 69 | configuration. |
Edwin Kempin | 497ac4a | 2010-12-28 12:55:22 +0100 | [diff] [blame] | 70 | |
| 71 | GERRIT |
| 72 | ------ |
| 73 | Part of link:error-messages.html[Gerrit Error Messages] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 74 | |
| 75 | SEARCHBOX |
| 76 | --------- |