0

I made three changelist on top of each other in gerrit CL1 cl2 cl3

so when I look at the git log in cl3 checkouted (via git review -d 3), I see the changes from CL1 and CL2.

I was asked to amend CL1 and move some of the changes to C2. After amending CL1, when I checkout cl2 or 3 I of course still see the CL1 changes in there original form. How do I get CL2 and cl3 to have the amended changes from CL1

AC.
  • 835
  • 1
  • 9
  • 17

1 Answers1

1

You need to rebase CL2 up to CL1' (new CL1 patchset) to create CL2', then you need to rebase CL3 up to CL2' to create CL3'. Something like this:

git checkout CL2
git rebase CL1'

Resolve conflicts
Change whatever you want

Add/Commit/Push

git checkout CL3
git rebase CL2'

Resolve conflicts
Change whatever you want

Add/Commit/Push

Always try to work your commits "in parallel" because that way you can change any commit you want without one affects the others.