我当时在做一个分支X。我做了一个承诺并推动了它。
然后我想把它cherry-pick到分支Y。但是,由于存在一些未合并的文件,我收到了以下消息:
error: 'cherry-pick' is not possible because you have unmerged files.
hint: Fix them up in the work tree,
hint: and then use 'git add/rm <file>' as
hint: appropriate to mark resolution and make a commit,
hint: or use 'git commit -a'.
fatal: cherry-pick failed现在,我只想删除我的分支Y,然后重新创建分支Y,然后手动编辑我试图选择的文件。
目前,我无法删除该分支,因为它是我的工作分支。我不能checkout任何其他分支。在试图更改分支时,我会得到以下错误。
mod/assign/locallib.php: needs merge
error: you need to resolve your current index first我只需要删除分支Y,而不会丢失分支X上的任何内容。
编辑#1
我编辑了文件mod/assign/locallib.php
在做git status时,我得到:
# On branch MDL-38267_24
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: mod/assign/locallib.php
#我应该在git add ..中添加哪些文件?
发布于 2013-05-09 02:41:42
因为您已经编辑了冲突文件,所以您只需要
git add mod/assign/locallib.php然后
git cherry-pick --continue发布于 2013-05-08 14:45:54
您试图进行合并(通过git merge或git pull),并有冲突尚未解决的文件。如果您执行git status,您可能会看到文件被列出为“被两者更改”。在做其他事情之前你得先处理好这件事。
做git mergetool,它会一次弹出一个文件。修复该文件,以便冲突得到解决,然后您应该能够继续。
https://stackoverflow.com/questions/16443501
复制相似问题