Git,'致命:樱桃选择失败'

xan*_*xan 23 git cherry-pick

我在一个分支机构工作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
Run Code Online (Sandbox Code Playgroud)

现在,我只想删除我的分支Y,然后重新创建分支Y,然后想要手动编辑我试图挑选的文件.

目前,我无法删除分支,因为它是我的工作分支.我不能checkout任何其他分支.尝试更改分支时出现以下错误.

mod/assign/locallib.php: needs merge
error: you need to resolve your current index first
Run Code Online (Sandbox Code Playgroud)

我只需要删除分支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
#
Run Code Online (Sandbox Code Playgroud)

我应该添加什么文件git add ..

pkt*_*yue 17

由于您已经编辑了冲突文件,因此您只需要

git add mod/assign/locallib.php
Run Code Online (Sandbox Code Playgroud)

然后

git cherry-pick --continue
Run Code Online (Sandbox Code Playgroud)