How to cherry-pick from a remote branch?

后端 未结 10 556
长发绾君心
长发绾君心 2020-12-07 11:17

I\'m having trouble performing a cherry-pick. On my local machine, I\'m currently on my \"master\" branch. I want to cherry-pick in a commit from another branch, named \"zeb

10条回答
  •  执念已碎
    2020-12-07 11:58

    Just as an addendum to OP accepted answer:

    If you having issues with

    fatal: bad object xxxxx
    

    that's because you don't have access to that commit. Which means you don't have that repo stored locally. Then:

    git remote add LABEL_FOR_THE_REPO REPO_YOU_WANT_THE_COMMIT_FROM
    git fetch LABEL_FOR_THE_REPO
    git cherry-pick xxxxxxx
    

    Where xxxxxxx is the commit hash you want.

提交回复
热议问题