1

I have following situation:

master      A - D - E
              \
feature         B - C

and I would like to go to this:

master      A - D - E
                     \
feature               B - C

How can I achieve such result in git / sourcetree? Note, that both branches have theirs counterparts on origin and are used by others.

zgorawski
  • 2,597
  • 4
  • 30
  • 43
  • you can merge or you can rebase, but both will change the C visible to others by adding changes from D and E. Or make a new local copy of the feature branch, and change it just for yourself. – Andras Dec 04 '14 at 06:28

1 Answers1

0

It would normally by a git remote master, but since the branches are already shared (changing the history of feature would be bad), it is best to merge master in feature and go on in the feature branch:

master      A - D - E
              \       \
feature         B - C- M - x - x ...

If you really want a branch starting from E, make a new one, and cherry-pick the commit from feature. Then push that new branch.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250