乌龟SVN树与自己冲突
有没有人有过这样的经历:在 tortoise 中移动文件并成功提交,但后来提交了不同的更改并被告知树冲突,其中:
- 原始位置的文件已被删除,但在 tortoise 中被标记为丢失
- 文件在其新位置中存在,但标记为已添加。
(我使用 tortoise SVN,并且我们的客户端和服务器> 1.60)
没有其他人更改目录或文件(根据 svn 日志)。
- 为什么会发生这种情况?
- 有没有办法避免这种情况的发生?
- 如果确实发生这种情况,是否有比删除整个文件夹并再次更新更优雅的方法来解决问题?
Has anyone had the experience of moving a file in tortoise and committing successfully, only to later commit a different change and be told of a tree conflict where:
- the file in its original location has been deleted, but in tortoise is marked as missing
- the file in its new location is there, but marked as already added.
(I use tortoise SVN, and we have client and server > 1.60)
Nobody else changed either the directory or the file (according to svn log).
- Why is this happening?
- Is there a way to avoid it happening?
- If it does happen, is there a more elegant way of fixing the problem than by deleting the whole folder and updating again?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
听起来您可能使用 Windows 资源管理器“移动”命令而不是 Tortoise“移动”命令移动文件。前者只是在文件系统中移动文件,而不更新颠覆树(从版本控制中删除旧文件并将旧文件的历史记录链接到新文件)。
始终使用TortoiseSVN“移动”命令,或者如果您想要移动没有历史记录的文件,请使用Windows资源管理器复制文件,使用Tortoise添加新版本,然后使用Tortoise删除旧版本。
您可以右键单击旧文件的父文件夹,选择“检查修改”,然后删除版本控制中标记为缺失的文件。
Sounds like maybe you moved the file using the Windows Explorer "Move" command rather than the Tortoise "Move" command. The former just moves the file in the filesystem without updating the subversion tree (removing the old file from version control and linking the old file's history to the new one).
Always use the TortoiseSVN "Move" command, or if you want a to move the file without history, then copy the file using Windows Explorer, add the new version with Tortoise, and then delete the old version with Tortoise.
You can right-click on the parent folder of the old file, choose "Check for Modifications," and then delete the file marked as missing from version control.
听起来您提交了该文件,但没有提交该文件移入/移出的目录。您还需要提交目录。
Sounds like you committed the file, but not the directories it was moved to/from. You need to commit the directories too.
我通过右击文件夹、选择“重命名”并使用“newpath\to\folder”作为参数陷入了树冲突。经过多轮失败的清理命令和其他一些操作后,我终于通过以下方式恢复了理智:
手动更新的文件的无缝历史链被破坏,但至少我现在可以继续工作。
I got into a tree conflict by r-clicking on folder, selecting 'rename', and using "newpath\to\folder" as a parameter. After many rounds of failed cleanup commands and some other stuff I finally restored sanity by:
The seamless history chain is broken for the manually updated files, but at least I can continue work now.