0

Is it possible to cherry-pick a commit from a first remote branch to another remote branch, without checkout any of the two branch?

sab
  • 4,352
  • 7
  • 36
  • 60
  • Why don't use checkout? Go to a new folder, clone the repo, checkout the branch in question, cherry-pick and push. – RiWe Jan 24 '20 at 09:42

2 Answers2

1

No, there is no possible to do that (all available commands on remote). You must have both branches locally (you may use different names than on remotes) and then do cherry-pick, and push.

Leszek Mazur
  • 2,443
  • 1
  • 14
  • 28
0

I don't know of a way to do this, at least not assuming that GitHub or Bitbucket be the remote Git providers. Of course, if the first branch were strictly some number of commits ahead of the second branch, then a merge would have the same effect as a cherry-pick, and this is possible via a pull request.

So what you will most likely have to do here is to checkout the two branches, do the cherry-pick, then push/create a pull request.

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360