[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Want to set up SVN for a web app

From: Les Mikesell <lesmikesell_at_gmail.com>
Date: Wed, 01 Apr 2009 11:33:14 -0500

Theodore H. Smith wrote:
> Hi everyone,
>
> So I want to set up SVN for a website. This website has a lot of php, perl, java, javascript, and swf...
>
> I've never used SVN before. I am really confused as where to start.

Start with the concept that every developer will have his own
independent checked out working copy. 'svn update' will pull changes
anyone else has committed to your copy; 'svn commit' will send your own
changes to the repository. You may prefer the GUI equivalents.

> We have multiple developers. And each developer mostly is working on separate projects that "link" together. Does that mean I need multiple repositories?

They probably need their working copies to be viewable by a test
instance of a web server. That's not always necessary but it simplifies
things if the checked-out layout is close enough to production for
preliminary testing.

> Also, we cannot make the entire website into the svn repository, because there are hundreds of thousands of user generated files lying around!

Some people try to run a working copy as their live site but it is
probably better to have a staging location where you would update,
perhaps do some final testing, then use some scripted mechanism to copy
from there to the live site(s).

> I'm thinking we need multiple repositories.

That's a matter of choice - you can put multiple projects under one
repository or each can be separate.

> So, what would our steps be?
>
> 1) Install SVN (done)
>
> 2) Make repositories for what folders, where? What command do I use? Will I risk deleting my source code? or what do I do?
>
> Let's say my source code is at /web/theo/
> but there are also other source code at /web/fred and another at /web/harry/
>
> what do I do?

The clean approach is to import your current 'master' copies to the
repository project/trunk location you created for each, then forget
about the old copies and check out new working copies for all subsequent
work. The repository is as safe as the filesystem it resides on.

> And then step 3?
>
> 3) How do I work with this thing? What files do I edit, and where? On my local computer? On the live server? And once my changes are complete, then what?
>
> As these are web app files, I generally want to edit my files in some kind of testing area on a server. But I also like to have the files downloaded to my computer for local editing. I kind of like to freely switch between the two, not worrying too much as long as I remember which one (on my computer or on the testing area on the server) is the most recent, then I can copy them across appropriately.

Everyone who makes changes should check out their own working copy. The
test framework is desirable but optional - if you can't arrange a test
framework everywhere you want to edit, you can update a copy on the
server where you test.

> Also, I tend to do my work by editing the file using Transmit for Mac, and a plain text editor. This is handy Transmit polls a local copy of a file downloaded from the server. Once it has found changes, it uploads the file back to the server! So basically this means Transmit allows ANY app to edit any file on my server, transparently! No need to worry about uploading, permissions, paths, passwords or any wierd stuff. Just edit with my favourite app, and away I go.
>
> Will SVN interfere with that?

Generally, svn would replace that: that is, you would have a local
working copy wherever you like to edit and use svn, ssh+svn or http(s)
for update/commit access to the repository.

-- 
    Les Mikesell
     lesmikesell_at_gmail.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1508716
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-04-01 18:34:16 CEST

This is an archived mail posted to the Subversion Users mailing list.