Git unmerged path问题

我把分支狗合并成动物。 当我去提交时,我得到以下内容:

Unmerged paths: (use "git reset HEAD <file>..." to unstage) (use "git add <file>..." to mark resolution both deleted: ../publichttp://img.dovov.comoriginals/dog.ai added by them: ../publichttp://img.dovov.comoriginal_files/dog.ai 

长话短说,我在每个分支有不同的目录名称和文件名称。 动物分支有我想要的变化。

当我去重置头,它不起作用。 而当我去采取任何其他的混帐行动(删除,结帐等),我得到一个path未find错误。

我需要执行哪些命令?

所有你需要做的是:

 # if the file in the right place isn't already checked in git add <path to desired file> # remove the "both deleted" file from the index git rm --cached ../publichttp://img.dovov.comoriginals/dog.ai git commit # commit the merge 

处理这种情况的另一种方法是,如果您的文件已经签入并且文件已经合并(但未提交,因此合并冲突被插入到文件中),则运行:

 git reset 

这将切换到HEAD,并告诉GIT忘记任何合并冲突,并离开工作目录。 然后,您可以编辑有问题的文件(search“更新上游”通知)。 一旦你处理了冲突,你可以运行

 git add -p 

这将允许您以交互方式select要添加到索引的更改。 一旦索引看起来不错( git diff --cached ),你可以提交,然后

 git reset --hard 

摧毁工作目录中所有不需要的更改。