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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

649 views 0 4
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