3

In Eclipse using egit, is it possible to cherry pick a commit (in my case on the currently checked out branch, e.g. master) onto another branch B without first having to check out B?

This would be quite a time saver...

NB, this is explicitly about cherry picking (involving merging) and not just fetching other branches as asked before

JRA_TLL
  • 1,186
  • 12
  • 23
  • Possible duplicate of [Fetch and Merge into all Branches at once from Upstream Repository](https://stackoverflow.com/questions/49033529/fetch-and-merge-into-all-branches-at-once-from-upstream-repository) – phd May 23 '18 at 16:49
  • Cherry-pick performs merge and there is no way to do merge with non-current (not checked out) branch. – phd May 23 '18 at 16:50
  • To my knowledge, that's not possible, neither in Eclipse nor with the command line Git. I wrote an Eclipse JGit based application that (if possible) propagates a commit from the master to multiple other branches via cherry picking. But this requires a separate working tree/directory to check out the target branch. – howlger May 23 '18 at 20:49

1 Answers1

-1

To Cherry Pick a commit from another branch in Eclipse:

  1. Switch to the branch where you want to get the commit
  2. Select the project in 'Project Explorer' tab and look for the 'History' tab.
  3. Make sure that in the History tab is enabled 'Show All Branches and Tags'
  4. Search for the commit to cherry pick, select it, right click and 'Cherry-Pick'
  5. If the case solve conflicts
  6. Commit and push
Maxim Z
  • 1
  • 2
  • Works, but does not answer my question, which says "onto another branch B without first having to check out B". Your answer presumes B is checked out. – JRA_TLL Jun 27 '22 at 08:16