On Tue, Jul 11, 2017 at 4:05 PM, Ralf Hemmecke <hemme...@gmail.com> wrote: > If it is only a small difference to just one file on another (diverged) > branch, then why not simply create a patch and apply it to the right branch. > > Something like this. > > git checkout mybranch > git format-patch -k1 # if it is just on commit > # This gives a file 0001-... > git checkout master > git am 0001-... > > I thought that cherry-pick does exactly that, but I've had more success > with the above sequence. Especially if previous commits on "mybranch" > conflicted with the diverging master, but the commit on top of mybranch > applied cleanly.
cherry-pick basically does exactly that. If a patch doesn't apply with cherry-pick it will give you the opportunity to resolve the merge conflict manually, which you'll probably have to do no matter what in most cases. I do this regularly and not sure exactly what the problem is... > On 07/11/2017 03:32 PM, Simon King wrote: >> On 2017-07-11, Daniel Krenn <kr...@aon.at> wrote: >>> On 2017-07-11 14:39, Simon King wrote: >>>> Being on a different git branch, I tried >>>> git cherry-pick xyz >>> >>> Why cherry-pick and not simply >>> git merge xyz >>> ? This could git help finding a proper merge base. >> >> Because I didn't want to merge the whole branch. It was only >> about the single commit. Moreover, I just tried "git merge" in a toy >> example, and it was not better than "git cherry-pick". >> >> I believe it is obvious that the branch which the xyz's changeset is >> being applied to (by cherry-pick or by merge) *always* is a better >> merge base than the branch that xyz comes from. >> >> Best regards, >> Simon >> > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-devel+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at https://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.