背景
在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
当尝试在new_feature分支上使用gitcherry-pick特定commit_id时遇到fatal:badobject错误。解决方法是先切换到commit所在的develop分支,执行gitpull更新代码,然后回到new_feature分支进行cherry-pick操作。
1万+

被折叠的 条评论
为什么被折叠?



