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

Create new branch from tag in Sourcetree

Markus Hubig May 7, 2013

Hi @all,

creating a new branch from a tag is one of my most used git operations.

$ git checkout -b new_branch tag_name

How can I do this with sourcetree? Just right-klick on a tag name on the left pane dosen't give me this option ...

1 answer

1 accepted

4 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 7, 2013

When you (left) click on a tag in the sidebar it'll navigate to that point in the log. You can right-click on this commit in the log (indeed, on any commit) and select 'Branch...' to create a branch from that point.

Markus Hubig May 12, 2013

Ah top! Thank you!

Premesh Purayil May 27, 2015

WHen i do this and try to push that branch up to origin i get this error git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --set-upstream origin 19.0:19.0 Pushing to http://gitlab.xxxx.com/engineering/xxx.git error: src refspec 19.0 matches more than one. error: failed to push some refs to 'http://gitlab.xxxx.com/engineering/xxx.git'; Completed with errors, see above.

gcreech March 28, 2018

This is only part of the answer.  The method described above, branches only at the SHA.  Does not have an option for tracking.  Because Windows version (not sure about MAC) has an issue with "greyed" out tracking screen (will it ever git fixed :-)), there is a manual step of tracking the branch to the remote that can be done in the terminal shell.

git branch -u origin/<remote branch name> <local branch name>

This is for the case of an existing branch that is on the remote.

BTW - I have version 2.4.8.0 of Sourcetree - when in the remote list on the left, right clicking does allow branch creation with tracking option.  This seems to answer the original post.  One thing that is missing from that process, is that there is no option for not checking out the branch.  If the checkout is done, at least tracking is available (not greyed out) .  Wish the two branch dialogs were consistent.  There are times when it is inconvenient to do a checkout, but still want to setup a local branch on the remote.  As for the tracking menu issue/bug/feature, that is another story.

PS - Just noticed that this was talking about tags (no children) ... my response was for an existing branch ...  still very similar..

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events