HowTos / SvnImport

Importing projects into a Subversion Repository

Next: Using Subversion


To import from a directory in your linux account to the lab repository:

$svn import -m "Importing project widget" ~/MyProjects/ProjectWidget file:///lab/subversion/myname/ProjectWidget/trunk

It is not necessary to include your name in the lab repository structure, and for group projects it is probably better to exclude it.

To import from one directory of your linux account to a repository in your home directory:

$svn import -m "Importing project widget" ~/MyProjects/ProjectWidget file:///home/myname/svn/ProjectWidget/trunk

Note, in all cases, you need to use the full path to the repository.

In the above commands you are importing the project that you have been working on (~/MyProjects/ProjectWidget) and putting it in your repository directory. You are also making a note of what you are doing by using the -m and the description in quotes. Any time you are adding or making other changes to a repository, you should include -m, followed by a brief description of the changes you have made in quotes. If ProjectWidget/trunk does not exist yet in your repository, the import command will create it.

You can now import additional projects in the same way. You can also import projects from another computer. This is covered in HowTos.SvnRemote. Btw, Subversion will not make any changes in the original project directories you are importing from. I generally make sure these are on a backup somewhere, and then get rid of them, so I don't have an old version of my software which isn't being updated by subversion laying around to confuse me.

If you did create a directory structure like shown on the previous page, you probably want to import to file:///home/myname/svn/ProjectWidget without the trunk part, since that will be imported with your directory structure.

You are now ready to get a working copy of your repository and start working.

Next: Using Subversion

Svn - Introduction to Subversion
SvnImport - Importing projects into a Subversion Repository
SvnRemote - Accessing your Subversion Repository Remotely
SvnSetup - Setting up Your Subversion Repository
SvnWork - Basic Subversion Work Cycle