next up previous contents
Next: Checkout a project Up: Basic Operations Previous: Basic Operations   Contents

Adding a project in the repository

After we have created a repository we can add a project to it. We should, however, choose a project layout before adding it. The layout is related with how we manage our tags and branches. Tags are snapshots of the project in time, for example a given verion of the product is released; branches are parallel directions of development. Tags do not change since they represent the the state of the code of a partical moment in the past.

A common layout is the following

/project/trunk
        /branches
        /tags

The trunk contains the main line of the devopment. The branches in most case are created from the trunk. This layout is per-project - if we add another project it will look like this:

/project/trunk
        /branches
        /tags
/project2/trunk
         /branches
         /tags

It is also possible to define trunk, branches and tags directories per repository:

/trunk/project
      /project1
/branches/project
         /project1
/tags/project
     /project1

Since Subversion allows copying and moving of files and directories, it is possible to start with one layout and move to a different one. We will use the first one when adding our new project:

$ ls helloworld/
branches        tags            trunk
$ ls helloworld/trunk
src             tests           ....

So trunk contains out project. We import it with the following command:

$ svn import helloworld https://localhost/svn/repo1/helloworld
Adding         trunk
...
Adding         trunk/src
...
Adding         branches
Adding         tags

Committed revision 1.

Subversion adds all the files and directories in the repository and marks it as revision 1. There is one global revision for the whole repository - there are no separate revisions for each file or directory. Every change committed to the repository increments that global revision with one.


next up previous contents
Next: Checkout a project Up: Basic Operations Previous: Basic Operations   Contents
Ivan Ivanov 2008-04-21