背景
在
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