1

On Gerrit I have the following patch order:

A (newest)
B
C
F
G
H
D
E
...

On my local git repository I have:

P1 (newest)
P2
P3
A
B
P4
C
D
E
...

However, the patches A B C D E have all been updated to another patch set and I would like to take the new patch set in my local repository for all those patches.

For a small amount of cherry-picked patches, I usually do a git rebase and update the hash but that does not scale well for many patches to be updated and I would like to avoid having to manually cherry-pick them one by one again.

How can I update my cherry-picked patches?

Stoogy
  • 1,307
  • 3
  • 16
  • 34

1 Answers1

1

If P4 is independent of the other patches you can use:

git rebase -i <remote branch>

and by removing the patch A, B, C... of the list of patches in the interactive window, it will give you a branch that looks like:

P1 (newest)-> P2 -> P3 -> P4 -> A -> B -> C ->...

Otherwise you can try to pull using the rebase option:

git pull --rebase

But you may still have to resolve conflicts.

An explication of this command is given here: Difference between git pull and git pull rebase --rebase

Elieva
  • 136
  • 4