我将分支 dog
merge 到 animal
中。当我提交时,我得到以下信息:
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution
both deleted: ../public/images/originals/dog.ai
added by them: ../public/images/original_files/dog.ai
我在每个分支中有不同的目录名和文件名。 animal
分支具有我想要的更改。
当我去重置头部时,它不起作用。当我执行任何其他 git 操作(删除、 checkout 等)时,我会收到一个path not found
错误。
我需要执行什么命令来解决这个问题?
最佳答案
您需要做的就是:
# if the file in the right place isn't already committed:
git add <path to desired file>
# remove the "both deleted" file from the index:
git rm --cached ../public/images/originals/dog.ai
# commit the merge:
git commit
关于git - 如何解决 git status "Unmerged paths:"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3207029/