How to cherry-pick from a remote branch?

后端 未结 10 563
长发绾君心
长发绾君心 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条回答
  •  Happy的楠姐
    2020-12-07 12:16

    I solved this issue by going on the branch with the commit I want to cherry pick.

    git checkout 
    

    use log to find commit hash

    git log
    

    when you've found your hash cut and paste on note pad. if using command just scroll up to get the hash then checkout the branch you want to place the commit in.

    git checkout < branch I Want To Place My Cherry-Picked-Hash In>
    

    finally call cherry-pick from git (note) -x is to append your cherry-pick message to the original. "When recording the commit, append a line that says "(cherry picked from commit …​)" to the original commit message in order to indicate which commit this change was cherry-picked from. "

    git cherry-pick -x 
    

提交回复
热议问题