乌龟SVN树与自己冲突

发布于 2024-09-03 22:13:52 字数 335 浏览 4 评论 0原文

有没有人有过这样的经历:在 tortoise 中移动文件并成功提交,但后来提交了不同的更改并被告知树冲突,其中:

  1. 原始位置的文件已被删除,但在 tortoise 中被标记为丢失
  2. 文件在其新位置中存在,但标记为已添加。

(我使用 tortoise SVN,并且我们的客户端和服务器> 1.60)

没有其他人更改目录或文件(根据 svn 日志)。

  1. 为什么会发生这种情况?
  2. 有没有办法避免这种情况的发生?
  3. 如果确实发生这种情况,是否有比删除整个文件夹并再次更新更优雅的方法来解决问题?

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:

  1. the file in its original location has been deleted, but in tortoise is marked as missing
  2. 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).

  1. Why is this happening?
  2. Is there a way to avoid it happening?
  3. If it does happen, is there a more elegant way of fixing the problem than by deleting the whole folder and updating again?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

时光病人 2024-09-10 22:13:52
  1. 听起来您可能使用 Windows 资源管理器“移动”命令而不是 Tortoise“移动”命令移动文件。前者只是在文件系统中移动文件,而不更新颠覆树(从版本控制中删除旧文件并将旧文件的历史记录链接到新文件)。

  2. 始终使用TortoiseSVN“移动”命令,或者如果您想要移动没有历史记录的文件,请使用Windows资源管理器复制文件,使用Tortoise添加新版本,然后使用Tortoise删除旧版本。

  3. 您可以右键单击旧文件的父文件夹,选择“检查修改”,然后删除版本控制中标记为缺失的文件。

  1. 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).

  2. 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.

  3. 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.

你的背包 2024-09-10 22:13:52

听起来您提交了该文件,但没有提交该文件移入/移出的目录。您还需要提交目录。

Sounds like you committed the file, but not the directories it was moved to/from. You need to commit the directories too.

雪花飘飘的天空 2024-09-10 22:13:52

我通过右击文件夹、选择“重命名”并使用“newpath\to\folder”作为参数陷入了树冲突。经过多轮失败的清理命令和其他一些操作后,我终于通过以下方式恢复了理智:

  1. 在另一个文件夹中打开新的干净签出
  2. svn 从干净签出中删除并提交损坏的“newpath\to\folder”
  3. 选择“oldpath\folder” r-click拖动并 svn 移动到新位置
  4. 立即提交更改,中间没有其他操作
  5. 转到损坏的签入“oldpath\folder”并手动将删除或留下的文件复制到“newpath\to\folder” '
  6. 添加手动复制的文件,就好像它们是新的一样。

手动更新的文件的无缝历史链被破坏,但至少我现在可以继续工作。

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:

  1. open new clean checkout into a different folder
  2. svn deleting and committing the broken 'newpath\to\folder' from clean checkout
  3. select 'oldpath\folder' r-click drag and svn move to new location
  4. immediately commit change with no other operations in the middle
  5. go to broken checkin 'oldpath\folder' and manually copy files which were dropped or left behind to 'newpath\to\folder'
  6. add manually copied files as if they were new.

The seamless history chain is broken for the manually updated files, but at least I can continue work now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文