Cherry pick using TortoiseGit

GitTortoisegit

Git Problem Overview


How do I run the cherry pick command using TortoiseGit UI?

Git Solutions


Solution 1 - Git

  1. Open the log in a repository with the target branch checked out.
  2. Use the top-left blue branch name to select the source branch.
  3. Select the commit(s) you want.
  4. Right click and select Cherry Pick this commit.

Solution 2 - Git

Considering 'release' branch is required to cherry-pick from 'master' branch, follow the steps as provided below:

Step 1: Checkout 'release' branch

enter image description here

Step 2: Click TostoiseGit -> Show log

enter image description here

Step 3: Filter Source Branch Commits to be Cherry-picked

On the Log Messages window, select the source branch from where the commits will be Cherry Picked (i.e. 'master' branch in this example). The branch selection can be done from top left of the 'Log Messages' window (as shown below)

enter image description here

Step 4: Select the Commits to be Cherry-picked

Finally select the commits and right-click the context menu to cherry-pick them.

enter image description here

Solution 3 - Git

The above answers are also correct and I am just simplifying it.

If you want to cherry pick from one branch to another (for example: Branch_18.1 to Branch_18.4)

  • Go to Branch_18.4 folder(repo)
  • Right click and select show log, it will open a log dialog window
  • In this window, at top left Corner click on Current branch Hyperlink (i.e. Branch_18.4)
  • Now select the branch from which you want to cherry pic (i.e. Branch_18.1)
  • Now select and right click on the commit which to be cherry picked and select Cherry pick selected commits.
  • Now It may ask you to stash your changes if you have any changes in your working tree then in that case click on "YES" .
  • Now Before pushing cherry picked changes, pull and then Push.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionantonjsView Question on Stackoverflow
Solution 1 - GitvpatilView Answer on Stackoverflow
Solution 2 - GitAshraf AlamView Answer on Stackoverflow
Solution 3 - GitYATENDRA SHARMAView Answer on Stackoverflow