Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

repository - the remote copy of the code on the Subversion server; often abbreviated to "repo" or sometimes called the "remote repository"

working copy - your local copy of an SVN folder within a repository, including any local changes you have made

structure node - a container within a repository that can have files in it or another structure node; similar to a directory in a file system

folder - aka structure node; also sometimes used to refer to directories in the local working copy that represent the local copy of these folders

global revision - every repository has a global revision which tags its current  contents and is incremented after each commit; in Subversion commands these will always start with 'r' as in 'r1234'

commit - push your changes to the repository (making a new global revision)

structure node - any part of the repository under the root, which can be conceptualized as a directory on a file system, with the repository root as the "/" or root directory

working copy - your copy of an SVN structure node from the repository, including any local changes you have made

folder - usually means some structure node in the repository or the working copy

trunk - the remote repository's current, main revision of a project

revision - globally unique number in the repository starting with "r" that tags the entire state of the repository after a commit

...

All commands described below assume you are in a terminal using bash on Linux or a similar Unix OS; also (mostly) assumed is , most commands assume that the current local directory is an SVN structure node that has been checkout checked out of the repository.  

Most of the arguments used for these example commands are completely bogus and, depending on the command, should be replaced by valid paths to files in your working copy or the remote repository.

If you really want to experiment with some of the more advanced commands (branching, merging, etc.) you might think about setting up your own test repository as doing this kind of stuff on an actual production repository if you are just testing or fooling around is not recommended!

 

Checkout a Folder from SVN

You can checkout structure nodes as directories on your local file systemMost commonly, you will checkout folders from SVN to local directories using a command such as this.

No Format
svn co svn://example.org/repo/some/dir

svn:// is the protocol (for talking to the SVN server).

example.org is the host name of the SVN server.

repo is the name of the SVN repository (SVN Servers can have multiple repositories).

some/dir is a folder in the repository.

You could also checkout the entire repository.

No Format
svn co svn://example.org/repo/

But it is probably not a good ideaThis will work for the root repository URL or any sub-node within it.

Show Working Copy Information

...

Each file listed with this command will have a letter next to it representing its status.  The meaning of these abbreviation is fully described here.

...

Show Changes in Working Copy

You can use the diff command to show changes between the repository and your working copy.

No Format
svn diff | less

This will display the changes in diff format between working copy files and the repository.

You can also specify a file or dir

No Format
svn diff some/file/or/dir

Show Folder Contents

You can list the contents of a directory on in the server repository using this command in your working copy.

...

No Format
svn ls svn://repo/some/path/

Show Changes in Working Copy

You can use the diff command to show changes between the repository and your working copy.

No Format
svn diff | less

This will display the changes in diff format between working copy files and the repository.

You can also specify a file or dir

No Format
svn diff some/file/or/dir

This command ignores (always?) your working copy and always looks at the folder on the server.

Update Working Copy from Repository

You should periodically update your working copy from the repository to keep it up to date.

The entire local An entire working copy can be updated by executing a command like this.

...

No Format
svn up some/dir some/file another/file

You should periodically update your working copy from the repository to keep it up to date.

Add Files

This command can be used to add files to the repository.

...