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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

419 views 0 1
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