Tuesday, November 08, 2011

Creating a New Project in SVN

It had been over a year since I'd created a new SVN project, so of course I forgot how and had to waste an hour trying to figure it out. Assuming a remote SVN server with SSH and working keys...

On the server:
cd /svnrepos
svnadmin create newproject
The project should now be visible in WebSVN.

On the client:
mkdir -p /tmp/newproject/{branches,tags,trunk}
cd /tmp/newproject
svn import -m "New Project" . \
Refresh WebSVN, and the three sub directories should be displayed, but we need to "prime the pump" by uploading an active item.
cd trunk;
svn co svn+ssh://websvn/svnrepos/newproject/trunk .
touch dummy.txt; svn add *
A         dummy.txt
svn ci . -m "First"
Click the trunk link in WebSVN, and the new file should be visible and the project should be active. Unfortunately, its in the wrong place... this is in /tmp.

Wipe out the "prime" directory:
rm -rf /tmp/newproject
Move to the "real" location and checkout the new project:
cd /some/path
svn co svn+ssh://websvn/svnrepos/newproject/trunk .
svn del dummy.txt; svn add *; svn status
Populate the directory with the project files. The next check-in should remove the dummy.txt file and sync with the server.