C# SVN 不断损坏带有“<<<<<<< .mine”的文件,如何解决?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2012810/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SVN keeps corrupting files with "<<<<<<< .mine", how to fix?
提问by MysticEarth
I've got a Visual Studio C# project which is under version control (SVN). I've always commited and updated the project without any problems. But a couple of hours ago Visual Studio throws the following error when I try to launch/rebuild the project:
我有一个受版本控制 (SVN) 的 Visual Studio C# 项目。我一直在提交和更新项目,没有任何问题。但是几个小时前,当我尝试启动/重建项目时,Visual Studio 抛出以下错误:
Files has invalid value "<<<<<<< .mine". Illegal characters in path.
文件具有无效值“<<<<<<< .mine”。路径中的非法字符。
I don't know how to fix this problem. What should I do?
我不知道如何解决这个问题。我该怎么办?
采纳答案by Benjamin Podszun
That happens when svn encounters a conflict: You changed a file, the file on the server was changed and it cannot (easily) be merged automatically. Youneed to decide what is the correct solution now.
当 svn 遇到冲突时会发生这种情况:您更改了文件,服务器上的文件已更改,并且无法(轻松)自动合并。您现在需要决定什么是正确的解决方案。
Subversion just adds the diff into your source file (and creates files next to it, called OriginalName.mine (unchanged) and OriginalName.rsomething (unchanged, server version)).
Subversion 只是将差异添加到您的源文件中(并在它旁边创建文件,称为 OriginalName.mine(未更改)和 OriginalName.rsomething(未更改,服务器版本))。
Fix the conflict and tell subversion that this is resolved.
修复冲突并告诉 subversion 已解决。
回答by Confusion
Remove the code that shouldn't be in the file throwing the error and remove the the three files with extensions .mine, .<somerevision>
and .<some_other_revision>
. svn updated files that now contain 'conflicts' and you need to resolve these conflicts by hand. Usually this means you edited a file, someone else edited the same file and checked in changes and you didn't pay attention when checking out the changed file.
删除不应该在抛出错误的文件中的代码,并删除三个扩展名为 .mine, . <somerevision>
和 。<some_other_revision>
. svn 更新现在包含“冲突”的文件,您需要手动解决这些冲突。通常这意味着您编辑了一个文件,其他人编辑了同一个文件并签入了更改,而您在签出更改的文件时没有注意。
回答by Wim Coenen
Please read the Basic Usagechapter in the subversion book. It has a section about Merging conflicts by handwhich explains the conflict markers you're seeing.
回答by Bert Huijben
If you have AnkhSVNor VisualSVNinstalled resolving this is most likely as easy as right clicking the file in the solution explorer and selecting edit conflict.
如果您安装了AnkhSVN或VisualSVN,解决这个问题很可能就像在解决方案资源管理器中右键单击文件并选择编辑冲突一样简单。
This will open the changed file in your merge editor. (See Tools->Options->Source Control->Subversion User tools for AnkhSVN). With a good merge tool like the free to use SourceGear DiffMergeor TortoiseMerge, resolving the conflict is just a few mouseclicks away.
这将在合并编辑器中打开更改的文件。(参见工具->选项->源代码控制->AnkhSVN的Subversion用户工具)。使用免费的SourceGear DiffMerge或 TortoiseMerge等优秀的合并工具,只需点击几下鼠标即可解决冲突。
回答by Chev
I have had this happen on a large scale where the files get marked resolved but the conflict metadata is still there. I wrote a regular expression for visual studio to find these, for instances where it is not feasible to simply revert the changed files.
我已经大规模发生这种情况,文件被标记为已解决,但冲突元数据仍然存在。我为visual studio编写了一个正则表达式来查找这些,例如在简单地还原更改的文件不可行的情况下。
回答by done_merson
Removing the debug folders worked for me (see comment-not answer above). I got this after moving 12 folders from one section of svn to a new section. So if you get this after moving a project and the error does not point to an actual file, this is likely your issue.
删除调试文件夹对我有用(请参阅上面的评论-未回答)。在将 12 个文件夹从 svn 的一个部分移动到一个新部分后,我得到了这个。因此,如果您在移动项目后得到此信息,并且该错误未指向实际文件,则这可能是您的问题。
回答by Abhishek
I closed the IDE, then deleted the obj folder and restarted the IDE and rebuilt my Code. This worked for me.
我关闭了 IDE,然后删除了 obj 文件夹并重新启动了 IDE 并重建了我的代码。这对我有用。
回答by marcg
just delete the obj folder and it will worked fine.
只需删除 obj 文件夹,它就会正常工作。
回答by Rajkumar
Inside your project :
odj folder -> Debug -> project name.csproj.Filelistabsolute.txt(snb.csproj.Filelistabsolute.txt)
Inside the text file
>>>>>>>.mine
and>>>>>>>.r150
occurs to remove the things the program works
在您的项目中:
odj folder -> Debug -> project name.csproj.Filelistabsolute.txt(snb.csproj.Filelistabsolute.txt)
在文本文件中
>>>>>>>.mine
并>>>>>>>.r150
发生删除程序工作的事情
回答by Rohan Gala
1)Just save your local changes whatever u have edited in the file
1)只需保存您在文件中编辑的本地更改
2)revert the file
2)恢复文件
3)update it from SVN
3)从SVN更新它
4)Paste your local changes
4)粘贴您的本地更改