Short novice guide for importing a project to Subversion
My new employer uses Subversion as the central version control system, so I'm trying to take the first steps as my former employer still used the good old CVS. (This also means that you don't find advanced infos here but only novice infos.)
So, how to import an existing project to Subversion? I don't mind loosing the history of the project, of course this makes the whole migration process a lot easier.
1. Create a Subversion repository
First, a central Subversion repository has to be created if it does not exist already:
2. Import an existing project to the trunk
So, let's import the project directory myproject
to Subversion. I already
learned that the recommended structure should be as follows:
As in a non-Subversion project, the trunk
, tags
and branches
directories
usually do not exist yet, they have to be created first. The import sequence for the project directory myproject becomes as follows:
As the Subversion repository is locally visible, I use the file://
schema.
Don't forget to add myproject
to the last command or all files in svn_myproject
will be imported directly into the root directory of the repository.
You cannot work directly with the created myproject_svn
directory above,
you first have to checkout it again:
3. Create a branch
Creating a branch is just a Subversion copy:
Here, the trunk/
directory is copied recursively in the working
directory brances/myproject-branch
. The output of the command svn status
indicates that the directory is ready to be added to the repository.
The +
says that branches/myproject-branch
is just a copy and nothing new.
When commiting, Subversion creates the directory in the repository:
Subversion does not really copy all files, but just creates a new repository entry pointing to the original tree, so this is also called a “cheap copy”. Please refer to the Subversion documentation for more detailed infos.
The one step method without the need of a temporary directory is as follows:
Original post: http://peter-on-java.blogspot.com/2012/08/short-novice-guide-for-importing.html