Introduction

After checking out the source from CVS, you might want to modify it and commit changes. CVS will make sure your changes stay in sync with those of other developers and report any problems it can't resolve.

Enable CVS for your project

In IntelliJ, open File/Settings/Version Control and select CVS as version control. Modified files will now turn blue untill you commit them. Newly added files will be green. Local files will be gray.

Updating your local directory

Before committing your changes to the CVS server, you must make sure all your files are up to date (except for your local changes). This way you take into account changes that other developers have commited to the server. This process called a CVS update.

In IntelliJ, right click on the project root ( simplegamenet) and select CVS/Update. Mark the option to prune empty directories. You 'll get a status list. Watch out for merge conflicts. Normally you won't get merge conflicts.

Update frequently. Actually update every time you open IntelliJ. Do an extra update prior to committing any source.

Solving merge conflicts

When another developer has committed a change to a file you have changed locally, the CVS update will try to merge them. If you have worked on different parts of the file, merging shouldn't be a problem. If you haven't, you 'll probably get a merge conlict.

Merge conflicts are evil. Resolve them immediatly. Open the file with the merge conflict and take a look at the file. The file will contain the remote version as well as your local version. Change the file so only one remains and any CVS notes are gone.

Build and run before committing

I can't stress this enough: Successfully build and run before committing! Not all functionally must be added however.

When other developers update their local directory, they must still be able to build and run the project and test their changes. Therefore you shouldn't commit any broken source. There is no harm to wait to commit your changes for days or even weeks. Just update frequently. However, as soon as you have something that builds and runs, commit it, so other developers see your changes.

Commit your changes

If your code successfully builds and runs, commit your local changes to the remote directory. When other developers can update their local directory, they receive those changes. If a release of the project is made, it will contain your changes. This process is called a CVS commit.

In IntelliJ, right click on the project root ( simplegamenet) and select CVS/Commmit. You 'll get a list of files to commit. Make sure you don't commit any generated files or files that should remain local. So don't commit the target directory, build.properties or IDE configuration project files. Make sure you've added to CVS your new files and deleted from CVS your removed files, before commit those changes. IntelliJ should prompt you to add to CVS or delete from CVS a file when appropriate.