Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Rebase after Cherry-Pick

Let's say i have to branches:

dd2e86 - 946992 - 9143a9 - a6fd86 - 5a6057 [master]
           \
            76cada - 62ecb3 - b886a0 [development]

Now a commit from devel is required in the master branch, so i cherry-pick it:

git checkout master
git cherry-pick 62ecb3

Assumed that some hotfixes are committed to master, can the development branch be safely rebased?

like image 317
user3428756 Avatar asked Aug 21 '26 19:08

user3428756


1 Answers

There is 2 different cases:

  1. When you did your cherrypick, you did not have merge conflicts (and also not have change these lines since) , so you won't have problems when rebasing and git will figure it out that the change is already in the branch and will "ignore" the changes made by this commit.

  2. You did have merge conflicts during the cherrypick, so you MUST do a rebase interactive to remove the line of this commit to avoid conflicts again

like image 120
Philippe Avatar answered Aug 24 '26 09:08

Philippe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!