How to apply the same changes (in several commits) to different branches?
First of all, this is different from How to copy commits from one branch to another? as the purpose is different, thus the answer there was specific for that question.
I've got a project that has a master branch and a stable branch - the branches diverged long time ago. Now I need to backport a fix to that stable release branch -- I've got a couple commits on the master branch, which I also want to have on the stable branch (a bug fix). I cannot merge, as the branches diverged and there's loads of unmerged changes - I just want my 8 commits.
Actually the answer from How to cherry pick a range of commits and merge into another branch? is more close to what I'm looking for,
However that answer begins with:
When it comes to a range of commits, cherry-picking was not practical.
and didn't give clear git
command for people to follow.
UPDATE: The proposed answer GIT cherry pick all my commits that exists in one branch to another branch does not solve my problem as I've explained in the comment right away -- that question, "I want to cherry pick all commits that doesn't already exist in branch A from branch B to branch A without the need to manually search for every single one", is different than what I'm asking here.