Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Creating a new branch in SourceTree

S Green September 30, 2015

Hello!

I created a new branch in SourceTree, committed my changes and then pushed to a remote.
My question is: why doesn’t the graph visually show the branch (diagonal line)? The new branch name does show under BRANCHES in left panel, but just not on the graph. The graph only shows a straight vertical line of nodes.

Here’s what I did:

1 - under BRANCHES on left, I double-clicked “master” to check out the latest and use as my current working source.

 

2 - edited files

 

3 - hit the Branch button in top menu bar

 

  • Current Branch: master

 

  • New Branch: branch-blue

 

  • hit “Pick”

 

  • selected the top item in list (master)

 

  • unchecked "checkout new branch"

 

4 - hit commit and entered message about changes

 

5 - hit push

  • selected new branch name ("branch-blue") & hit OK

After all this, SourceTree told me I was “one ahead” and the Push button still had a red indicator that I needed to push. So, I pushed again, this time selecting “master” as the branch to push. Only then where my changes pushed to remote. Why didn’t selecting my new branch work?

If I’d successfully pushed onto my new branch, shouldn’t I visually see that new branch in the graph?
What did I need to do differently here to actually create and push on the new branch?

Where can I find documentation on the New Branch dialog (step 3 above)? For example, documentation on Working copy parent vs. pick (and what to pick)?

Thanks in advance!

1 answer

2 votes
Seth
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.
September 30, 2015

Since you unchecked "checkout new branch", you changes were committed to master, not the new branch.

The graph won't show a separate line for the branch until it has its own commit.

Seth
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.
September 30, 2015

Additional info about push - the push dialog doesn't push your latest commit to the selected branch, it pushes changes to your local copy of the branch to the remote copy of the branch.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events