SVN协作失败
今天是我第一天使用SVN。 然而,有一种情况我无法解决:
我在 2 台电脑上结帐 第一台电脑的电脑更改了文件中的某些内容并提交。 然后第二台电脑尝试提交:
Commit failed (details follow):
File '/classes/ghjs.html' is out of date
我必须在第二台电脑上运行更新,它从电脑 1 获取新文件,然后我可以再次正确提交,但是更新之前所做的更改会丢失。
如果您必须在编写一行代码之前提交/更新,否则处理同一文件的其他人没有您的最新版本,那么 SVN 就没那么棒了。
我知道没有什么“实时”协作的想法,但是如果您正在使用旧版本,则必须有一些东西,而不是更新,您可以手动将更改“移植”到最新版本。
我使用“versions”作为 svn 客户端,使用 textwrangler 作为编辑 php 代码的编辑器。
Today is the first day i'm playing with SVN.
However 1 situation i cant solve:
I checkout on 2 pc's
The first pc's Pc changes something in a file and commits.
The second pc then tries to commit:
Commit failed (details follow):
File '/classes/ghjs.html' is out of date
I have to run update on the second pc, it gets the new file from pc 1, then i can commit properly again, however changes done before updating are lost.
SVN isn't that awesome if you have to commit / update before you can write a line of code else other people working on te same file don't have you latest version.
I understand there isn't somethink for "live" collaboration, however there must be something that if you were working on a old version, instead of update you can manually "port" your changes to the latest version.
Im using "versions" as svn client and textwrangler as editor for editing php code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不,他们没有迷路。它们合并到您的本地副本中(正如您所期望的那样),更新后您可以承诺将它们添加到存储库中。如果合并导致冲突,您将收到通知,但仍然不会丢失任何工作。
如果您在更新后丢失了更改,那么您做错了什么——我对版本根本不熟悉,所以我不能说。
No, they aren't lost. They are merged into your local copy (just as you expect them to be), and after updating you can commit to add them to the repository. If the merge results in conflicts you will be notified, but still no work will be lost.
If you lost your changes after an update you did something wrong -- I 'm not familiar at all with Versions so I can't say.
对 pc 2 上文件的本地更改不应在
svn update
上丢失。它们将与 pc1 上所做的更改合并并提交。如果对冲突的相同行进行更改,则在冲突解决之前您将无法提交,选择保留任一文件版本的更改。不过,更新后您不应该丢失本地更改。Local changes to files on pc 2 should not be lost on an
svn update
. They will be merged with changes made on pc1 and committed. If changes are made to the same lines in conflict, you will be unable to commit until the conflict is resolved, choosing to keep the changes from either of the file versions. You should not lose local changes after updating though.然后您在 PC 2 上“更新”,它应该将 PC 1 的更改合并到 PC 2 的工作副本中。如果文件是在 PC 2 上编辑的,那么它应该完全合并它们,或者给出合并冲突,您可以手动解决它们。
这样做是为了让 SVN 有地方合并这两个更改。合并是在工作副本中完成的,而不是在服务器上完成的。
如果更新时 PC2 上的更改丢失,并且没有显示合并错误,那么这确实可能是一个问题。
Then you 'update' on PC 2, it should merge the changes from PC 1 into PC 2's working copy. If the file was edited on PC 2 then it should either cleanly merge them, or give a merge conflict and you can manually resolve them.
It is done this way so that SVN has a place to merge the 2 changes. Merges are done in a working copy, not on the server.
If your changes from PC2 are lost when updating, and no merge errors are shown, then that indeed could be a problem.