背景

new_feature分支上,想cherry-pick一下另一个分支develop上的提交,不想发生如下错误:

test git:(p/new_feature) git cherry-pick commit_id     
fatal: bad object commit_id

解决方法

先到该commit所在的分支上,pull一下:

test git:(p/new_feature) git checkout develop   
➜  test git:(develop) git pull origin develop   

然后再执行cherry-pick:

➜  test git:(develop) git checkout p/new_feature  
➜  test git:(p/new_feature) git cherry-pick commit_id
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐