Java Reference
In-Depth Information
All real-world development projects rely on a version control system to keep track
of source code changes. Using a version control system ensures that you can
always back out ill-conceived changes, maintain different sets of revisions
between customers, and prevent developers from overwriting each other's
changes. If you've been developing professionally for any length of time, you're
no doubt familiar with using a version control system to manage your source tree.
IDEA
has built-in support for a number of different version control systems,
allowing you to integrate source management seamlessly into your development
process. From within
IDEA
, you can check out projects, commit changes, view dif-
ferences, and perform other common tasks. The version control system is even
tied in with the refactoring process; as you rename classes or packages, the source
code repository is likewise updated.
Probably the most popular version control system is the Concurrent Version-
ing System (
CVS
), an open source product used by millions of developers for both
open source and commercial products. It has been available for a long time, and
for most platforms. Although it isn't as powerful as some of the commercial prod-
ucts, it's more than adequate for most projects and has the advantages of simplic-
ity and low cost going for it. This chapter will focus primarily on using
CVS
for
version control, but the principals and procedures discussed apply equally, with
few differences, to the other version control systems supported by
IDEA
.
8.1 Configuring your project for version control
Still using command-line
CVS
alongside
IDEA
? We've known many a
W
in
CVS
user
who has been hesitant to switch over to using their
IDE
as their version control cli-
ent. Why bother?
Convenience
. In
IDEA
,
CVS
support is seamless: When you create
a new file or rename a class, the change is ready to commit into the repository.
You can review your changes and commit your files with just a few clicks, without
leaving the
IDE
. We think you'll find it well worth investigating.
This chapter touches on some basics of version control, but for a more
in-depth look at the main concepts, specific commands, and common
terminology relating to the
CVS
system, visit the
CVS
documentation at
http://www.cvshome.org.
TIP
8.1.1
Understanding version control basics
If you've never used a version control system before, it's easy to get tripped up by
the concept. The full details of using the various version control systems sup-
ported by
IDEA
are too extensive for our discussion, but this section will introduce