Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start an SVN project from the command line?

Tags:

svn

So I have a ruby on rails application that I have created on my local computer. I have a remote repository that I've created. Now how do I check it in for the first time? I have never created my own svn project before, so I don't know how to do it. I've only made commits to projects that I've worked on.

Solution:

cd [my project dir] svn import -m "First Check-in" svn://[SubversionRunningMachine]/[ProjectName]/trunk 

This will check in the project. Now you have to check out the project.

svn co svn://[SubversionRunningMachine]/[ProjectName]/trunk NewProjectName 
like image 793
Andrew Avatar asked Jan 28 '10 05:01

Andrew


People also ask

How do I access TortoiseSVN from command line?

Locate TortoiseSVN and click on it. Select "Change" from the options available. Refer to this image for further steps. After completion of the command line client tools, open a command prompt and type svn help to check the successful install.


2 Answers

There are actually two ways to do this. One is through the use of import which doesn't put your active code base under version control. The other method is to just create an empty project in the repository and then check it out directly into the code base. Then just do an add and an a commit:

svn mkdir <repo>/newProject svn checkout <repo>/newProject /path/to/codebase svn add /path/to/codebase/* svn commit /path/to/codebase -m "adding initial codebase" 

There is a good tutorial on how to create a new project here: http://web.archive.org/web/20110316170621/http://www.duchnik.com/tutorials/vc/svn-command-reference

like image 58
Robert Duchnik Avatar answered Sep 24 '22 06:09

Robert Duchnik


You have to create the repository on the server first, then use the svn import command:

svn import <<URL>> -m<<comment>> 

This will add all of your files to the repository and then commit them in one step.

Alternatively, you can check out the empty repository (you should have at least /trunk, /tags, and /branches, check out /trunk) and then copy all of your files into the new working copy and add only the files/directories you want to commit. I prefer this method.

like image 43
Ken Liu Avatar answered Sep 25 '22 06:09

Ken Liu