How to cherry-pick from a remote branch?

后端 未结 10 583
长发绾君心
长发绾君心 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:57

    Need to pull both branch data on your local drive first.

    What is happening is your trying to cherry-pick from branch-a to branch-b, where in you are currently on branch-b, but the local copy of branch-a is not updated yet (you need to perform a git pull on both branches first).

    steps:
    - git checkout branch-a
    - git pull origin branch-a
    - git checkout branch-b
    - git pull origin branch-b
    - git cherry-pick

    output:
    [branch-b ] log data
    Author: Author 1 file changed, 1 insertion(+), 3 deletions(-)

提交回复
热议问题