How do I pull from feature branch A into new feature branch B?

Hi, I'm using gitflow and Source Tree.

If I update my development branch from upstream, it is possible to pull from the local develop into a feature branch thus bringing that branch up to speed.

However if I have a feature branch A and I want to go off and do a big refactor to try something I'm not sure I will keep. But I do not want to finish feature branch A, I want to create a feature branch B (based on develop) and then pull from feature branch A to experiment in feature branch B.

I am not able to do this from the pull menu when choosing 'Custom' to pull from local branches don't see anything under feature only master and develop. Is this by design or is it just a missing feature in the GUI?

2 answers

1 accepted

'Pull' actually just means 'Fetch and Merge' and is only really applicable to remote branches.

To bring your feature branch up to date with the develop branch, just merge the develop branch into your feature branch.

I did not want to get my feature branch up to speed with develop. I want one feature branch to be based off another feature branch.
Sorry, this should have been a comment....

To do that, you just create feature branch B from the last commit of feature branch A. You can do this by right-clicking that commit and selecting 'Branch', or by using the toolbar's Branch button and selecting 'Specific Commit' for the point at which you want the branch to start, and browsing to it from there. (If you're using git-flow, it has a similar way to specify where your feature branch will start from).

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

564 views 1 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you