SourceTree - How do I cherry pick?

Hi, I really don't find how I have to cherry pick, I'm pretty new to GIT (and SourceTree) and I would like to push certain files (or changes) to one or multiple branches. I don't want to merge completely. So how do I do this with SourceTree?

Thanks!

1 answer

1 accepted

In the log view (Cmd-2), just select one or more commit lines (Cmd-click or Shift-click multi-selects), then right-click and select 'Cherry pick'.

Is there a way to included the SHA of the picked commit in the comment, the way git cherry-pick -x does?

Not right now - at the time this feature was added, the -x behaviour was the default but it's been changed in git since to be an opt-in. i"ll add it to the feature requests.

Hi, what about cherry picking without committing? (git cherry-pick -n)

Re cherry-picking. I find that if I try to cherry-pick more than one commit at the same time which includes the tip of a branch, then the cherry-pick action fails with a message saying that a cherry-pick is already 'in progress'. Is this a bug?

+1 for the feature requests:

cherry picking without committing immediately - https://jira.atlassian.com/browse/SRCTREE-1026

including SHA in the commit message - https://jira.atlassian.com/browse/SRCTREE-1228

Selecting multiple doesn't appear to work actually. The confirmation message clearly says "the selected change", i.e., not plural. So I think you'll be doing it one at a time.

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

262 views 0 3
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot