无法解决 Bitbucket 中的合并冲突
Unable to Resolve Merge Conflicts in Bitbucket
在将我的分支代码与 master 合并时,我遇到了合并冲突,其中大部分都得到了解决,但我无法解决少数文件的合并冲突,因为我无法接受更改或暂存它们。
在 Sourcetree 中,每当我尝试使用 'theirs' 解决冲突时,我都会收到错误 - 'Cannot update one or more files, please check that no other application is locking your files' 而当我尝试使用 'mine' 解决冲突时,它不会显示此错误,它也不执行任何操作,合并冲突仍然存在。不太确定为什么我无法合并文件。
在尝试从编辑器手动合并每个文件时,没有显示错误或冲突,但我仍然无法暂存该特定文件。在 git 输出中,它显示没有要合并的更改,但此文件始终显示在“合并更改”部分中,但存在冲突。
正如this thread中所讨论的,当冲突涉及删除文件时检查是否是这种情况:
For me it seems like this happened with the "theirs" change being a delete, so "resolving using theirs" should delete the file.
I worked around it by marking the files as resolved then deleting them manually.
您在 SRCTREEWIN-2366 中也看到了类似的情况:
I think this error, at least for me, was a red herring. This happened to me and I tracked it back to a file that I had removed on one branch and changed on the other.
Source tree showed me this error when I tried to resolve with mine.
But, when I tried to resolve from the command line by checking out my version, git gave me an error that at 'ours' the file didn't exist.
I resolved the conflict to accept mine by knowing the file had been removed.
So, I just removed it myself then committed.
在将我的分支代码与 master 合并时,我遇到了合并冲突,其中大部分都得到了解决,但我无法解决少数文件的合并冲突,因为我无法接受更改或暂存它们。
在 Sourcetree 中,每当我尝试使用 'theirs' 解决冲突时,我都会收到错误 - 'Cannot update one or more files, please check that no other application is locking your files' 而当我尝试使用 'mine' 解决冲突时,它不会显示此错误,它也不执行任何操作,合并冲突仍然存在。不太确定为什么我无法合并文件。
在尝试从编辑器手动合并每个文件时,没有显示错误或冲突,但我仍然无法暂存该特定文件。在 git 输出中,它显示没有要合并的更改,但此文件始终显示在“合并更改”部分中,但存在冲突。
正如this thread中所讨论的,当冲突涉及删除文件时检查是否是这种情况:
For me it seems like this happened with the "theirs" change being a delete, so "resolving using theirs" should delete the file.
I worked around it by marking the files as resolved then deleting them manually.
您在 SRCTREEWIN-2366 中也看到了类似的情况:
I think this error, at least for me, was a red herring. This happened to me and I tracked it back to a file that I had removed on one branch and changed on the other.
Source tree showed me this error when I tried to resolve with mine.
But, when I tried to resolve from the command line by checking out my version, git gave me an error that at 'ours' the file didn't exist.
I resolved the conflict to accept mine by knowing the file had been removed.
So, I just removed it myself then committed.