01 January 2007

Importing a new subversion project

Say you want to import a project called contacts into subversion repository called main. First we create a dummy project to import, this creates the structure (trunk/branches/tags) for the project. Second we import the real project into the trunk area.

C:\sekhonp\it\builds>ls
drwx------+ 4 sekhonp None 0 Jan 1 15:24 contacts

C:\sekhonp\it\builds>mkdir emptyproject
C:\sekhonp\it\builds>mkdir emptyproject\trunk
C:\sekhonp\it\builds>mkdir emptyproject\branches
C:\sekhonp\it\builds>mkdir emptyproject\tags

C:\sekhonp\it\builds>svn import emptyproject http://svn.parwy.net/repos/main/contacts
Adding emptyproject\trunk
Adding emptyproject\branches
Adding emptyproject\tags

C:\sekhonp\it\builds>ls -al
drwx------+ 4 sekhonp None 0 Jan 1 15:24 contacts
drwx------+ 5 sekhonp None 0 Jan 1 15:26 emptyproject

C:\sekhonp\it\builds>svn import contacts http://svn.parwy.net/repos/main/contacts/trunk


We now have a repository structure that looks like:
main ->
contacts ->
trunk ->
project files...
branches ->
tags ->

You can now clean up and checkout the trunk of the project:

C:\sekhonp\it\builds>rm -rf emptyproject
C:\sekhonp\it\builds>rm -rf contacts
C:\sekhonp\it\builds>svn co http://svn.parwy.net/repos/main/contacts/trunk contacts
C:\sekhonp\it\builds>ls -al
drwx------+ 5 sekhonp None 0 Jan 1 15:43 contacts

No comments:

Post a Comment