Does the command rebase work in this case?

Hey there,

I have a somewhat special situation on the repository graph on left side of the picture.

After merging a couple of changes into the master, I accidently created the branch “me” from an old branch and not from the fresh “master”. I didn’t realize that until now and want to rebase (?) the branch “me” to the “master”, so that the new graph looks approximately like the one on the right side.

Is the command “rebase” the correct one or how am I able to adapt the branch “me” to the later added changes to “master”?

Thanks in Advance,
BleenPaper

Generally, rebase will replay commits in order against a new base (there’s some additional intelligence, but we can ignore it for now).

If there’s a conflict between the changes from a commit it’s trying to apply and the differences between the previous base and the destination, you’ll get a conflict. If you resolve the conflict and add the resolution to the stage (git add ...), then you can continue rebasing commits until you finish.

But, in short, yes, this is the right command to use.