当前位置: 动力学知识库 > 问答 > 编程问答 >

netbeans - What is the best way to share the new version of Java source code between a group of programmers?

问题描述:

I started to work with a group of five new programmers on a large project. I'm looking for the best way to share the source code between all the members. Each person is modifying different parts but all parts are related. I'm looking for a platform or way that when I change any parts of code they can see it on-line or as soon as possible.

Currently we conflicted with each other. For instance I worked on the parts of the source code and when I finish my job and I went back to our subversion repository which is google code to upload the new version. Then I realize someone else has been edited the code! What can I do in this situation?

We are using netbeans and everyone is working far away from each other so we can not have a face to face meeting.

网友答案:

You write about your subversion repository: well, that's good, because version control software is exactly what you need.

Conflicts can appear when people work on same parts of the code, but usually this doesn't happen too often. If it does, you should talk with your team members and set up a policy to update their local working copies more often. Another idea would be to set up subversion to send out e-mail notifications whenever someone commits changes.

When a conflict appears, the one who updates his local working copy has to resolve the conflict. Resolving doesn't mean to overwrite other people's work but to adjust local changes so that they work well together with the code which has already been committed to the repository by someone else.

网友答案:

If a lot of people are working on the same classes Subversion does a poor job of merging and as a result conflicts occur all too frequently. When conflicts do occur, the only solution is to resolve them - most IDEs have tools for this, as does Tortoise.

There's a few things you can do as a team to minimize conflicts:

  • change the minimum amount of code (avoiding formatting changes)
  • check in small changes
  • check in often
  • sync often

This does mean you have to be careful with your changes, so like everything in development there's trade-offs.

An alternative is switch to a distributed version control such at Git. DVCS is based on the need to merge and so do a far better job of it.

分享给朋友:
您可能感兴趣的文章:
随机阅读: