与多个用户一起使用 SVN
我们目前正在使用 SVN 来处理我们的代码。然而,有时我们会同时编码。
例如,3 个人查看同一个项目。用户 1 完成某件事并去签入。用户 2 和 3 如何在不丢失当前工作的情况下获得更新?我们尝试过更新命令,但通常会产生一些错误。
我们应该使用 SVN 以外的东西吗?
我正在使用 eclipse 的 svn 存储库。
We are currently using SVN to handle our code. However, sometimes we all code all at once.
For example 3 people check out the same project. User 1 gets something done and goes to check it in. How can Users 2 and 3 get the update without losing their current work? We've tried the update command but usually yields some errors.
Should we be using something other than SVN?
I am using eclipse's svn repository.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Subversion 专为您正在做的事情而设计。不过,您的问题可以通过对 Subversion 工作原理的基本了解来解决。我建议阅读 svn 书籍 的第 1 章和第 2 章。
此外,您在更新中看到的错误可能是冲突,这在本书中有所介绍。
Subversion is designed exactly for what you're doing. However, your questions are covered by a basic understanding of how Subversion works. I recommend reading Chapters 1 and 2 of the svn book.
Also, the errors you're seeing on updates are probably conflicts, which are covered in the book.
如果它产生错误,则意味着您对同一行代码进行了不兼容的更改,这会导致合并冲突。无论您使用哪种 VCS,如果您以不兼容的方式修补同一段代码,都会遇到相同的问题。
VCS 并不能始终解决合并问题。您需要一些协作规则来确定谁在处理代码的哪一部分,这将主要解决合并问题。
实际上,如果您遇到合并冲突,您需要手动解决它,提交回来并让其他用户更新他们的工作副本。
If it yields errors it means you made incompatible changes to the same lines of code, which leads to merge conflicts. Whatever VCS you'll use you'll have the same issues, should you be patching the same piece of code in incompatible ways.
VCS doesn't solve your problems with merging always. You need some collaboration rules as to who's working on which part of code and that will solve the merging issues mostly.
Practically, if you experience a merge conflict, you need to resolve it by hand, commit back and let other users update their working copy.
你可以尝试Git,但我怀疑问题出在源代码管理软件上。
您使用哪个客户端?更新不应产生错误。开发人员需要学习如何分支、更新、合并和提交代码。这并不总是容易的,但却是必要的。
需要遵循的一些规则:
Git 可以使合并变得更容易,但它并不能消除合并。
You could try Git, but I doubt that the problem is the source code management software.
Which client are you using? Update shouldn't be yielding errors. Developers need to learn how to branch, update, merge, and commit code. It's not always easy, but it's necessary.
A few rules to follow:
Git can make merges easier, but it doesn't eliminate them.