两个程序员处理相同的代码

发布于 2024-07-16 01:43:58 字数 209 浏览 3 评论 0原文

我正在与合作伙伴一起编写一些 PHP 代码,并且都在我们的计算机上本地运行 LAMP(或者在我的情况下为 MAMP)服务器。 有什么方法可以让我们同时处理同一段代码吗? 这需要我们的 IDE(我使用 Zend Studio,他使用 PHPed)和 MySQL 服务器在完成任何更改时进行更新。

PS - 是否有任何系统也允许对代码进行实时注释?

谢谢。

I'm working on some PHP code with a partner, and were both running a LAMP (or in my case - MAMP) server locally on our machines.
Is there some way we can both work simultaneously on the same piece of code? This would require both our IDE's (I use Zend Studio, he uses PHPed) and our MySQL server to update when any change is done.

P.S. - Is there any system that also allows real-time commenting on code?

Thanks.

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

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

发布评论

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

评论(7

晒暮凉 2024-07-23 01:43:58

据我所知,不同时,但你通常也不希望那样。 (如果您确实需要的话,请坐在同一台计算机旁。)

协作编码的公认工作流程是进行一组更改,对它们的工作感到满意,记录它们,集成来自您的好友的一些更改,确保它与您的最新版本兼容改变,然后重新开始进行一些新的改变。

您应该检查一些 DVCS 系统,例如 MercurialGit,允许您来回共享记录的更改(也称为提交)。

Not simultaneously AFAIK, but you usually don't want that either. (Sit by the same computer if you really need that.)

The accepted workflow for collaborative coding is to make a set of changes, be satisfied that they work, record them, integrate some changes from your buddy, make sure it works with your latest changes, then start again to work on some new changes.

You should check out some DVCS-system, like Mercurial or Git, that allows you to share recorded changes (aka commits) back-and-forth.

遮了一弯 2024-07-23 01:43:58

由于您已经使用 SVN,因此可以处理相同的代码,并且这是提交、更新和解决合并时可能的冲突的问题。 关于每个人将在应用程序的哪些部分工作的一些沟通肯定会有所帮助。

关于数据库的更改,这对我来说是如何工作的。 每个开发人员都在他的本地计算机上使用数据库的本地实例进行工作,在其中他可以进行实验并做任何他想做的事情。 当更改是永久性的时,他会提交一个 SQL 增量脚本,该脚本与代码一起进入存储库。

Since you already use SVN then working on the same code is possible and it's a matter of committing, updating and resolving possible conflicts while merging. A little bit of communication on what parts of the application each one will work on definitely helps.

Regarding changes on the db here is how it works for me. Every developer works on his local machine with a local instance of the database where he can experiment and do whatever he wants. When changes are permanent he commits an SQL delta script which goes into the repository together with the code.

流年里的时光 2024-07-23 01:43:58

您可以使用任何 emacs,并在其他机器上打开显示( Mx open-display )
或者你可以使用屏幕
或者你可以使用 VNC


刚刚在 Eclipse 中看到了这个: http://wiki.eclipse.org/DocShare_Plugin

You can use any emacs, and open display on other machine ( M-x open-display )
Or you can use screen
or you can use VNC


Just saw this for Eclipse: http://wiki.eclipse.org/DocShare_Plugin

錯遇了你 2024-07-23 01:43:58

如果您想同时处理相同的代码库,但代码的不同部分,SVN 是最好的选择。 但是,如果您确实需要同时处理相同的代码,则需要协作编辑器,例如。 Mozilla Bespin

在大多数现实生活中,第一个选择加上一些 IM 就足够了。

If you want to work concurrently on the same code base, but different parts of code, SVN is the best option. But if you really need simultaneous work on same code, you need collaborative editor like eg. Mozilla Bespin.

In most real life situations first option, together with some IM is more then enough.

西瑶 2024-07-23 01:43:58

如果您希望数据库同步,则需要使用同一服务器。
Eclipse 有一个名为 Cola 允许实时协作编辑,但我认为使用 2 个不同的 IDE 是不可能的。

If you want the database synchronized you need to use the same server.
Eclipse has a plugin called Cola that allows real-time collaborative editing, but I don't think that it's possible with 2 different IDEs.

遗弃M 2024-07-23 01:43:58

既然你使用 MAMP,我想你使用的是 Mac。 SubEthaEdit 用于实时协作。 http://www.codingmonkeys.de/subethaedit/

如果你想坚持自己的不同IDE 并需要实时更改我认为你必须自己编写一个脚本。

Since you use MAMP I suppose you are on a Mac. SubEthaEdit is for real-time-collaboration. http://www.codingmonkeys.de/subethaedit/

If you want to hold on to your different IDEs and need real-time-changes I think you have to write a script on your own.

情深缘浅 2024-07-23 01:43:58

我和别人也处于这种情况。 我们主要处理单独的文件,然后当我们有一些不会破坏网站的东西时,将我们的更改检查到颠覆中。 我们经常进行签入,并在其他人签入内容时更新我们的代码。

我们做的另一件有用的事情是在我们的测试服务器上有一个链接(与本地计算机上的 MAMP 安装分开),它将自动签出从存储库中获取最新版本的 php 代码并重新加载页面。 基本上使代码更新尽可能容易。

I am in this situation with someone else. We mostly work on separate files and then check our changes into subversion when we have something that doesn't break the site. We do frequent check-ins and update our code whenever the other checks something in.

The other helpful thing we did was to have a link on our test server (separate from our MAMP installations on our local computers.) which will automatically check out the latest version of the php code from the repository and re-load the page. Basically make it as easy as possible to get code updates.

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