The safest way to do this is:
Create a new branch from B
git checkout -b BPRIME SHA_OF_B
Make some changes, and commit them. you're graph will look like:
BPRIME B' / branch1 / G---H---I / / master A---B---C---D---E---F \ branch2 M---N---O
Then cherry pick the commits from BPRIME to each of the branches.
$ git checkout branch1 && git cherry-pick B' $ git checkout master && git cherry-pick B' $ git checkout branch2 && git cherry-pick B'
This is the safest option because you are not changing the history.