我正在分支X
。我做了一個提交併推送它。然後我想cherry-pick
它分支Y
。但由於一些未合併的文件提出,我得到了以下信息:'致命:櫻桃挑選失敗'與Git
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'返回的文件是一樣的。我應該如何解決我遇到的問題? – xan 2013-05-08 15:05:51
你需要解決衝突或'git reset'文件到非衝突狀態。取決於你做了什麼導致衝突。 – Schleis 2013-05-08 16:40:37