如何在合并其他分支之前复制提交?

时间:2014-08-11 14:37:55

标签: git

我做了一个提交(52c65fa),其中包含一些非常与分支相关的更改。然后我将master合并到分支中以解决冲突(544c9d9),然后我创建了一个pull请求。为了批准pull请求,我需要删除该提交(52c65fa)。我曾想过做另一个分支并将其移动到那里,但cherry-pick显示错误:

error: could not apply 52c65fa... 
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

图表是这样的:

  *   544c9d9 (origin/feat/error_hierarchy, feat/error_hierarchy) Resolved conflicts
 /|   
* |   cafe7d7 (origin/dev, dev) Merged in feat/follow_photo (pull request #10)
|\ \  
| * | 2032bff (origin/feat/follow_photo, feat/follow_photo) some other branch that have been merged
|/ /  
| * 52c65fa The commit that I want to copy
| * 82e24f5 other commits
|/  
*   e534410 (HEAD, feat/config_file_review) Merged in feat/logs_work (pull request #9)

我想添加提交的HEAD在哪里,我该怎么做?

1 个答案:

答案 0 :(得分:0)

我发现了问题:有冲突......我已经解决了它们并再次提交,现在这就是我想要的。