eclipse 子剪辑冲突解决
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1537980/
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
Subclipse conflict resolution
提问by Gok Demir
Me and my friend using flex builder (eclipse based) with subclipse for a project.
我和我的朋友在一个项目中使用带有 subclipse 的 flex builder(基于 eclipse)。
Before committing I always update but sometimes I could not commit because of conflicts. Then I use Team->Synchronize with Repository and it shows at the right side latest from repository and at the left side the my current working copy. It has a button to copy from all non-conflicts from right to left (from latest repository to my working copy). But there are still conflicting lines.
在提交之前,我总是更新,但有时由于冲突我无法提交。然后我使用 Team->Synchronize with Repository,它显示在存储库的右侧最新版本,左侧显示我当前的工作副本。它有一个按钮可以从右到左复制所有非冲突(从最新的存储库到我的工作副本)。但仍然存在相互矛盾的线条。
Sometimes I just want to copy from left to right but there is no button for that (I mean overwriting repository file lines with my lines). After copying non-conflicting parts from right to left I just want to commit left side (I want to overwrite and commit my final file to repository). I cannot commit because of these conflict issues. Then my friend can use Replace With-> Latest from Repository command to get latest overwrited version.
有时我只想从左到右复制,但没有按钮(我的意思是用我的行覆盖存储库文件行)。从右向左复制非冲突部分后,我只想提交左侧(我想覆盖并将我的最终文件提交到存储库)。由于这些冲突问题,我无法提交。然后我的朋友可以使用 Replace With-> Latest from Repository 命令来获取最新的覆盖版本。
Subclipse documentation is weak I could not find any good guide on the Internet. Could you explain subclipse conflict resolution step by step for a dummy like me? A video showing the steps, or an alien technology to fix it quickly will be fine. Are there any better (easier) solution for source control for eclipse?
Subclipse 文档很弱我在互联网上找不到任何好的指南。您能否为像我这样的傻瓜一步步解释子剪辑冲突解决方案?显示步骤的视频或快速修复它的外星技术都可以。是否有更好(更简单)的 Eclipse 源代码控制解决方案?
(I use subclipse 1.4)
(我使用 subclipse 1.4)
回答by blissfool
Yes, you are right. There is no button for that. in the Diff View(Side-by-Side View) the items in red are in conflict. They can not be automatically merged. You must review the item in conflict and manually resolve it by copying/editing the block of code that is in conflict.
你是对的。没有按钮。在 Diff View(Side-by-Side View) 中,红色项目存在冲突。它们不能自动合并。您必须查看有冲突的项目并通过复制/编辑有冲突的代码块来手动解决它。
After committing to or updating from repository(Synchronize with Repository) you'll see in the Console view that some items are in conflict. When you take a look at that file in Package you'll see 3 files right next to your original file:
提交到存储库或从存储库更新(与存储库同步)后,您将在控制台视图中看到某些项目存在冲突。当您在 Package 中查看该文件时,您会在原始文件旁边看到 3 个文件:
myfile.txt (original file)
myfile.txt.mine
myfile.txt.r3293
myfile.txt.r3501
Right-click your original file then select Team -> Edit Conflict. In the Diff View provided, edit the file on the left-side to match the final result you want. (i.e. You may want to keep some of your changes and copy over new update from the revision in SVN, discard all changes and only keep your changes, etc.) After you are done, save the file. Right click your original file again then select Team -> Mark Resovled.
右键单击您的原始文件,然后选择 Team -> Edit Conflict。在提供的差异视图中,编辑左侧的文件以匹配您想要的最终结果。(即,您可能希望保留一些更改并从 SVN 中的修订版复制新更新,放弃所有更改并仅保留您的更改等。)完成后,保存文件。再次右键单击您的原始文件,然后选择 Team -> Mark Resovled。
You will see that the addition 3 files disappear. You can now "safely" commit your work.
您将看到添加的 3 个文件消失了。您现在可以“安全地”提交您的工作。
There is no easy way to do this since SVN can't decide what's the best option when such conflict arise.
没有简单的方法可以做到这一点,因为当出现这种冲突时,SVN 无法决定什么是最佳选择。
回答by eternay
I know this thread is old, but if someone is looking for an updated answer, my experience can help.
I'm using subclipse 1.8. Right-clicking on the original file and selecting "Mark Resolved...", you'll have several options, among others, take the local file or the base file as the correct version. You can save time with these options.
我知道这个帖子很旧,但如果有人正在寻找更新的答案,我的经验可以提供帮助。
我正在使用 subclipse 1.8。右键单击原始文件并选择“标记已解决...”,您将有多个选项,其中包括将本地文件或基础文件作为正确版本。您可以使用这些选项节省时间。
回答by princepiero
I can't find "Mark Resolved" so instead I clicked "Mark as Merged" after manually deleting the generated files.
我找不到“标记已解决”,因此我在手动删除生成的文件后单击了“标记为已合并”。
回答by Hasan
Do the following steps:
执行以下步骤:
Copy your latest working updates to a safe place.
Select the file which has conflicts..right click > select replace with>>Select Latest from Repository.
Then go back to your saved working copy and manually replace the current file contents (which has been overwritten in above step) with yours.
Then from team select Commit... This way conflicts should be resolved and you saved your latest updates to SVN Repository.
将您最新的工作更新复制到安全的地方。
选择有冲突的文件..右键单击>选择替换为>>从存储库中选择最新的。
然后返回到您保存的工作副本并用您的手动替换当前文件内容(在上述步骤中已被覆盖)。
然后从团队中选择 Commit... 这种方式应该解决冲突,并且您将最新更新保存到 SVN 存储库。