[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: Ryan Schmidt <subversion-2009a_at_ryandesign.com>
Date: Thu, 2 Apr 2009 05:33:18 -0500

On Apr 1, 2009, at 19:19, Theodore H. Smith wrote:

> Thanks a lot Ryan,
> great answer.
> One question, which will make me look like a total noob, but
> whatever...
> Are there two or more ways to export something? I mean "export" in
> the common English sense, not "svn export".
> "svn update" if I read correctly, will update all the files in your
> "working copy" to what is in the repository...
> and then there is "svn export" to put a working copy whereever I want.
> what about "svn commit"? Does that automatically update files in a
> certain location?

"svn checkout" creates a working copy on your local computer (or
wherever you check out) containing whatever's in the repository
location you specified. Example: if you want to have the latest
source code of Subversion itself:

svn checkout http://svn.collab.net/repos/svn/trunk svn-trunk-wc

If changes have occurred in the repository since you checked out,
"svn update" will bring those changes from the repository into your
working copy. Example:

svn update svn-trunk-wc

"svn commit" is for sending changes you've made in your local working
copy back to the repository. Example:

svn commit svn-trunk-wc

"svn export" creates a directory that contains the files from your
working copy path or from your repository URL, without all the
administrative Subversion data that makes it a working copy. This
directory cannot be used to pull new changes from the repository or
to push your changes to the repository. Example:

svn export svn-trunk-wc svn-trunk-export


svn export http://svn.collab.net/repos/svn/trunk svn-trunk-export

This should all be explained fairly well in the excellent book which
we all still think you should read. :)

> I guess my question is, does the import folder, after having been
> imported, have any special significance? If I delete that folder,
> will it be automatically recreated by "svn update"?
> Or let's say I DIDN'T delete the folder that I initially imported
> from. Then I modified a working copy and committed it back into
> svn. What happens to the folder I initially imported from? Does it
> get the modifications?

When you first put code into the repository, you might use "svn
import" to import an existing unversioned directory into some place
in the repository. Once you've done this, you discard the directory
you imported, and check out a working copy.

Or, if you want the directory you're importing to become a working
copy, then you don't use "svn import" at all; instead, you do a so-
called "in-place import" described here:


> Or is it that SVN basically stores its stuff in a "Repository",
> which basically is something we can't or shouldn't access from the
> file system, and the only "proper" way to get stuff out of it, is
> from a "working copy"?

Yes. The repository is a kind of database. You cannot see its
contents without using a client program designed to do so (e.g. a
Subversion client).

To make changes to its contents, you want to get a working copy, if
you want to do Subversion operations like update and commit on it, or
you could get an export if you don't care to be able to do those things.

> I'll make sure to look at svn:externals as I do tend to use a lot
> of centralised code. I am highly disciplined :)


P.S: Please use Reply All so your reply goes to the list too, not
just to me.


To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-04-02 12:34:12 CEST

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