git cherry-pick不工作 [英] git cherry-pick not working

查看:354
本文介绍了git cherry-pick不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试挑选来自主人的提交并将其提交到当前的生产分支。然而,当我执行 git cherry-pick< SHA-hash> 时,我只是得到这个消息:

 #在分支上prod_20110801 
#未记录文件:
#(使用git add< file> ...来包含将要提交的内容)
#site / test-result /
没有添加任何内容提交但存在未跟踪的文件(使用git add跟踪)
之前的樱桃选项现在为空,可能是由于冲突解决。
如果你想提交它,请使用:

git commit --allow-empty

否则,请使用'git reset'

注意:我试过重置和重置 - hard HEAD ^,而且两者都没有改变。 / p>

我很困惑为什么这不适合我。



任何见解,建议或关于如何解决这个问题的想法会有所帮助〜!

解决方案

Git正在将樱桃选项解决为无操作 - 该提交引入的所有更改都已通过当前分支上的一些提交引入。 (不管怎么说,这就是Git所认为的)。验证你选择樱桃的提交还没有被合并,或者是合并,rebase / cherry-pick或者零碎的补丁。 (使用 git show< commit-id> 查看差异。)


I'm trying to cherry-pick a commit from master and get it into the current production branch. However, when I execute git cherry-pick <SHA-hash>, I just get this message:

# On branch prod_20110801
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#   site/test-result/
 nothing added to commit but untracked files present (use "git add" to track)
 The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git reset'

Note: I've tried doing a reset and a reset --hard HEAD^, and neither seemed to change anything.

I'm confused as to why this isn't working for me.

Any insight, advice, or ideas on how to resolve this would be helpful~!

解决方案

Git is resolving the cherry-pick as a no-op -- all of the changes introduced by that commit have been introduced by some commit on your current branch. (Or that's what Git thinks, anyway.) Verify that the commit you are cherry-picking hasn't already been merged somehow, as either a proper merge, rebase/cherry-pick, or piecemeal patch. (Use git show <commit-id> to see the diff.)

这篇关于git cherry-pick不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆