与多个开发人员签入和签出文件的方法

发布于 2024-08-26 07:52:00 字数 450 浏览 5 评论 0 原文

我是一名 Web 开发人员,与包括我在内的 2-3 个人一起工作。我们当前的设置非常简单。当我们正在处理特定文件时,我们会尝试让彼此知道。我们使用 FTP 来编辑文件。

最近,我们遇到了这样的问题:两个人不小心编辑了一个文件,或者处理本地文件然后上传,而另一个人也做了同样的事情。

根据我所读到的内容,我需要某种控制系统。我听说过颠覆和善变。看来这些系统可能不是我所需要的,因为它只是给了我不同版本的文件。我不知道它是否解决了两个人处理一个文件并覆盖彼此工作的问题。

您对解决我的问题有何建议?

编辑 1:我应该提到,我想与 Netbeans 集成,Netbeans 似乎有可用的 Subversion 插件。

编辑2:是否可以使用普通的网络托管来做到这一点? (使用rackspace云站点托管)。我确实在家里设置了一台服务器,我认为可以将其设置为存储库。 (运行Windows Server 2007)

I am a web developer working with 2-3 people including me. Our current setup is very simplistic. We try to let each other know when we are working on a specific file. We use FTP to edit our files.

Recently we have run into the problem of 2 people accidentally editing one file, or working on a local file then uploading when another person just did the same.

From what I have read I need some sort of control system. I have heard of subversion and mercurial. It seems that these systems may not be what I need though, since its just giving me different versions of the files. I don't know if it solves the issue of two people working on a file and overwriting each others work.

What are your suggestions for solving my problem?

Edit 1: I should mention that I would like to integrate with Netbeans which seems to have plugins for Subversion available.

Edit 2: Is it possible to do this with normal web hosting? (using rackspace cloud site hosting). I do have a server set up at home that I think could handle being set up as a repository. (runs windows server 2007)

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

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

发布评论

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

评论(7

女皇必胜 2024-09-02 07:52:00

版本控制系统 (VCS) 正是您所需要的。开发人员在源代码管理中处理文件,当更改签入系统时,如果其他人也对同一文件进行了更改,系统将合并 2 组更改(有时来自用户将是必要的),而不是简单地丢失之前的一组更改。

可以定期从 VCS 存储库更新该网站。

团队只有 3 名左右的开发人员,几乎任何 VCS 都应该可以正常工作。我听说过有关 Mercurial 的好消息(尽管我还没有使用它 - 我计划这个月尝试一下),而且 Subversion 确实非常好。

但我认为你选择的任何内容都会比不使用任何内容有重大改进。

A version control system (VCS) is exactly what you need. The developers work off of the files in source control, and when a change is checked back in to the system, if changes have also been made by someone else to the same file, the system will merge the 2 sets of changes (sometimes assistance from the user will be necessary) instead of simply losing the previous set of changes.

Periodically, the website can be updated from the VCS repository.

With a team of just 3 or so developers, almost any VCS you might should work just fine. I've heard good things about Mercurial (though I haven't used it yet - I'm planning to try it out this month), and Subversion is really quite nice.

But I think anything you chose will be a major improvement over using none.

人海汹涌 2024-09-02 07:52:00

您可以使用 subversion,它充当所有文件的中央存储库,并处理文件冲突。

如果两个成员正在处理同一个文件,并且在更新 subversion 存储库中的文件时,他们将看到一条错误,通知他们存在冲突,并且还允许您比较两个文件之间的差异。

You can use subversion, it acts as a central repository for all your files and also handles the file conflicts.

If two members are working on the same file, and at the time they update the file in the subversion repositry, they will see an error notifying them about the conflict and also allow you to compare the differences between the two files.

樱花落人离去 2024-09-02 07:52:00

是的,您肯定需要进行某种源代码控制。除了协调多个开发人员之间的更改之外,您还可以回滚到软件的先前版本。您会发现它使您能够抓住机会尝试想法,因为您知道您始终可以将其转储并返回到以前的版本。当您继续开发下一个版本时,它对于跟踪错误报告也非常有价值。这样的例子不胜枚举,但是,一旦您意识到源代码控制的价值,您就永远不会像没有源代码控制的编码那样走钢丝。

Subversion 非常流行,但我建议您跳至 http://hginit.com/ 并阅读Joel Spoelsky 对 Mercurial 的介绍。这么说吧,他并没有立即接受它,但通过阅读教程,我发现这可能是处理事情的更好方法,特别是当人们分散时。

Yes, you definitely need to get on some sort of source control. Besides just coordinating changes across multiple developers you'll be able to roll back to previous version of your software. You'll find it enables you to take chances with ideas, knowing that you can always just dump it and go back to a previous version. It can also be invaluable in tracking down bug reports when you've moved on to developing the next version. The list goes on and on, but, once you realize the value of source control, you'll never want the tightrope walking that coding without source control is.

Subversion is very popular, but I'd encourage you to hop over to http://hginit.com/ and read Joel Spoelsky's introduction to Mercurial. Let's just say he was not immediately sold on it, but reading through the tutorial, I'm seeing that it's probably a better way to handle things particularly when folks are distributed.

绿阴红影里的.如风往事 2024-09-02 07:52:00

是的,它确实解决了您遇到的问题。看一下 svn book 了解更多详细信息。

所有版本控制系统都必须
解决同样的基本问题:
系统将如何允许用户
共享信息,但阻止它们
不小心踩到每一个
别人的脚?这一切都太容易了
用户不小心覆盖了每个
其他人在存储库中的更改。

Yes it does solve the problem you are having. Take a look at the svn book for more details.

All version control systems have to
solve the same fundamental problem:
how will the system allow users to
share information, but prevent them
from accidentally stepping on each
other's feet? It's all too easy for
users to accidentally overwrite each
other's changes in the repository.

奈何桥上唱咆哮 2024-09-02 07:52:00

此方法解决的另一个问题是意外地对文件进行了错误的编辑并想要恢复到以前的版本。 Subversion 将针对多个文件作为变更集(组成代码版本的一组变更)进行操作。

我也遇到过类似的情况(网络上的 .zip 文件与“锁定”zip 文件的批处理文件共享)。不好玩,而且肯定容易出现各种错误。

在这里查看一本关于 Subversion 的不错的免费书籍: http://svnbook.red-bean.com/< /a>

Another problem this solves is accidentally making bad edits to a file and wanting to revert to a previous version. Subversion will operate against multiple files as a changeset (a set of changes that comprise a version of the code).

I've been in a similar situation (.zip files on network share with batch file that "locks" the zip file). Not fun and definitely prone to all kinds of errors.

Have a look here for a decent free book on Subversion: http://svnbook.red-bean.com/

失而复得 2024-09-02 07:52:00

Subversion 非常适合分布式开发。

每个开发人员都处理自己的副本并检查更改。所有变化都是可逆的。

远离主要通过锁定文件然后“签出”文件来工作的源代码控制系统。 SVN 的默认模式是无锁工作,仅在发生冲突时合并更改并处理冲突。

Subversion 是最广泛支持的,Linux 开箱即用地支持它,而 TortoiseSVN (http://svn.tigris.org )作为 Windows 资源管理器插件。

Subversion is well suited to distributed development.

Each developer works on his own copy and checks in changes. All changes are reversible.

Stay away from source control systems that work primarily off of locking files then they are "checked out". The default mode for SVN is working without locks, merging changes and handling conflicts only when they arise.

Subversion is the most widely supported, with Linux supporting it out of the box, and TortoiseSVN (http://svn.tigris.org) as a Windows Explorer plugin.

╰沐子 2024-09-02 07:52:00

是的,您需要版本控制系统,但不需要任何版本控制系统。我认为您需要一个分布式版本控制系统。在我的公司,我们使用 SVN 很长一段时间(一个小型​​开发团队,和你一样),但我们从未对此感到太满意。几个月前,我们将每个存储库迁移到 GIT 以及所有项目管理和存储库托管已迁移到代码库。我们对迁移感到非常满意,因为有了存储库管理,一切都变得更加简单和直接。

查看免费的 Progit 书籍,了解 Git.

Yes, a Version Control System is what you need, but not any VCS. I think you need a Distributed Version Control System. In my company we where using SVN for a long time (a small development team, same as you) but we never were too happy with it. A few months ago we migrated every repository to GIT and all the project management and repository hosting was migrated to codebase. We are very happy with the migration because of repository management and everything is much more simpler and straightforward.

Check the free Progit Book for an excellent introduction to Git.

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