3

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?

user3428756
  • 87
  • 2
  • 5

2 Answers2

2

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

Philippe
  • 28,207
  • 6
  • 54
  • 78
0

The commit would be repeated albeit with a different sha-hash. Best way to go about this would be

  • Do an interactive rebase on master
  • Delete the cherry-picked commit
  • Force push master to remote
  • Rebase master onto develop.
TheGeorgeous
  • 3,927
  • 2
  • 20
  • 33