我正在分支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 ..
中我应该添加哪个文件?
git status
返回的文件是相同的。我该如何解决我遇到的问题? - xangit reset
为未冲突状态,具体取决于导致冲突的原因。 - Schleis