In our Gerrit setup we do not have the Move Change plugin enabled, yet we have a lot of changes on branch A, which we want to move to branch B with minimal distribution.
The only way I've found to do this thus far is to checkout the change on branch A on a local repo, then:
git push origin HEAD:refs/for/B
This creates a new change, on branch B, "Cherry Picked" from the change I'm trying move on branch A. This means we'd need to abandon the old change on branch A, thus creating more of a mess than I'd like (we'd essentially be duplicating every change we want to move).
Is there any way to just move the change via the git CLI? I'd prefer to update the branch in a similar manner as one would upload a new changeset and not create a new change.
Move Change is not a plugin but a core feature, available since version 2.13. Since version 3.0.0 it's possible to disable it on the server config. (Note that the config is available since 3.0.0 but only documented since 3.0.3).
If the version of Gerrit is older than 2.13, or 3.0.0 or later with the feature disabled, it's not possible to move a change's destination branch. You would have to abandon it and re-upload a new one to the correct branch.
For 3.0.0+ you could ask the server admin to enable the feature, although if it's disabled it means it was disabled deliberately; it's enabled by default. One reason people might want to disable it is that it doesn't automatically rebase moved changes on the new destination, which can cause unwanted commits to be included. See issue 12216.
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