SourceTree: How can I merge from a tag?

I am able to merge from the tip of a branch but do not see an option to merge from a tag. Is this possible within SourceTree?

1 answer

1 accepted

1 vote
Answer accepted

Are you wanting to merge the entirety of a branch up to a tagged commit, or just the single commit?

To "merge" just the one commit, you want to right click the commit (no tag necessary) and "Cherry pick" it.

To merge a branch up to a tag that isn't the latest commit in that branch, you'll need to create a new branch on that commit, then merge with the new branch.

Tags are just named commits. There is really nothing you can do with them that you can't do with a commit hash.

Yes, I want to merge the entirety of a branch up to a tagged commit. Using the Git command-line I can do this in one step (i.e. git merge <tag>) so I was expecting a way to do this in one step using SourceTree withouth having to create a new branch.

I will consider submitting an enhancement request for this functionality to be added to SourceTree

Well since I typically merge from a tag on a different branch (not the one I have checked out), I need to be able to display the history & tags of the other branch to be able to right-lick it, but that does not appear to be possible in SourceTree

Looks like you may be able to right-click any commit in the graph and choose "Merge...". I haven't tried this myself, so I don't know what to expect.

Sure you can. Above the graph, change the dropdown from "current branch" to "all branches".

Ahhh, didn't realize that! However I now find that I have too much information making it tought to find the tag that I want with lots of scrolling required. Is there a way to easily zero down on the tag that I am looking for?

Use the Search tab, right click on the commit you want and "View in Full Log".

Took me awhile to find the "Search tab" right at the bottom. This tab allows me to search by Authors, Commit Messages and File Changes but not by tags which is not that straight-forward as I might know the tag name but not necessarily the commit mesasge associated with it.

The "Jump to" option in the top right-hand corner seems to hold more promise. However the drop-down does not have a scroll-bar making it tough to find the tag I am looking for (if it is way down in the list) and requiring me to scroll a lot using the mouse wheel. Can this be enhanced?

The "Jump to" option also contains a "Jump to Commit" option within it. It would be great if this could be enhanced to provide the ability to Jump to branch or tag that is typed in

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,227 views 4 2
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