How to start an SVN project from the command line?

Viewed 91162

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
3 Answers

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.

Related