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 ...
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.