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

Magnus Andersson May 23, 2013

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

0 votes
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2013

'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.

0 votes
Magnus Andersson May 29, 2013
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.
Magnus Andersson May 29, 2013
Sorry, this should have been a comment....
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 29, 2013

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
TAGS
AUG Leaders

Atlassian Community Events