views:

371

answers:

4

I understand that the "SVN Checkout" command will do the initial get of file(s) from the Subversion repository and bring them locally to your working directory/copy and that the "SVN Update" command will get changes to file(s) from the repository if changes have been made by others. It seems to me though that an "Update" is just a special case of a "Checkout", ie when a Checkout occurs, it's getting all files since none yet exist locally and hence ALL of the files have "changed", and that behind the scenes these commands are doing largely the same thing. I assume the commands exist separately just as a means of simplification?

Or, are there other differences between the commands, e.g. does "SVN Update" get files get new files (files that exist in the repository that you don't have in your working copy) or just updates to existing files?

+3  A: 

Update will update your checked out version to the latest version (or a specified other revision) in repository. If you have made changes to your working copy, they will still be there after the update. If files have been added or deleted to the repository, that will be reflected in your working copy. If there are changes both in your local copy and in the repository SVN will try to merge all changes for you, if that doesn't work it'll flag for a conflict that you resolve manually.

svinto
You can update to any revision, not just the latest.
Michael Hackner
Sure you can update to the latest. This is what svn update does if you specify HEAD as the revision, or if you do not specify a revision at all.
Mike Miller
A: 

Subversion uses hidden directories of metadata to enable the functionality it provides. These .svn directories are what makes a directory into a Subversion working copy -- without these, it's just a directory and Subversion can't do much with it.

UPDATE is an operation that is performed over a Subversion working copy; no .svn directories, no UPDATE. CHECKOUT is the operation that creates a working copy.

Eric Kolb
+9  A: 

As I see it, the big difference is that checkout creates a working copy, whereas update brings down changes to an existing working copy.

karoberts
+1  A: 

svn checkout copies all the versioned files from the given directory in the repository at the given revision (default HEAD), and copies them to your local machine. It also generates all of the hidden .svn directories, and the meta-data within them, that make these files a working copy.

svn export copies all the versioned files from the given directory in the repository at the given revision (default HEAD), and copies them to your local machine, but produces a standard directory hierachy. (It does not produce a working copy that can be updated or checked back in).

svn update applies changes to an existing working copy. If, in doing so, a conflict is discovered the user is alerted and must resolve this before being able to commit any changes. When using svn commit it is a requirement that the working copy to be committed is up to date (ie. the same revision as HEAD).

Edd