QuickStart with Subversion
In software development, using a revision/version control system (VCS), such as Subversion, is highly recommended. A revision control system should make each developer's life much easier, whether you're an individual developer, or a team of developers.
These instructions provide a step-by-step walk through of getting a new project into Subversion. They assume that you have Subversion (command line) already installed.
Why Subversion?
If you're evaluating a VCS for your organization, you should note that Subversion isn't the only product on the market. Subversion has seen increasing popularity, and has become the defacto "default" for many projects. It is used by the AppFuse product, and, as an example of its ubiquity, its server and client tools are now bundled by default in Mac OS X (10.5+).
Before making the leap though - especially if you're a larger team - you will want to make sure that it's the most appropriate tool for your organization. Alternative tools that are also open-source:
- Git: distributed VCS, GPL v2 licensed.
- Mercurial: distributed VCS, written in Python; GPL licensed.
- Bazaar: distributed VCS, also written in Python; GPL licensed.
- CVS: GPL licensed; still widely used, but seen as deprecated by many developers, in favor of Subversion.
There are also many commercial tools available: Perforce, BitKeeper, and Microsoft's Visual Studio Team System amongst the most popular.
That said, if you're an individual developer, its . In any case, NO VERSION CONTROL SYSTEM is definitely worse than one.
Create your Subversion Repository
1. Create your AppFuse project.
2. Change into the directory where you created your AppFuse project
cd appfuse
3. If you have already run one of the following commands:
mvn jetty:run
mvn jetty:run-war (or mvn jetty:run)
mvn integration-test
mvn test
then you'll likely have build artefacts in your AppFuse project directory. Its a good idea to remove these artefacts out of your project directory, before importing your project directory into AppFuse.
mvn clean
| Useful Information Although you can delete these artefacts later on, there is no need for them to be in the versioning history in the first place. |
4. Run SVN's import feature to bring the contents of the directory into
your Subversion repository.
svn import . https://repohost/svn/repo/trunk -m "initial import" --username user
5. Change to the directory one up in the file system
cd ..
6. Then, rename the directory for
mv appfuse appfuse-svn-import
| Hint on Naming your Import Directory I like the following naming conventions for the directories that I import: <project_name> |
7. Then check out a working copy of your project from the Subversion repository:
svn co https://repohost/svn/repo/appfuse/trunk appfuse-project
8. If you didn't run mvn clean in step 3, then remove any build artefacts, logs, etc.
svn remove *.log
svn remove target/*
svn commit -m "Removing log and build files from the repository"
9. Add file ignores for the following working files:
svn propset svn:ignore "*" target svn commit -m "Ignoring all files in /target/"
10. You should be all set to start making changes to your project, and then
commit the results every time you make a substantial change.