[Main Page]

Go4IT forge: Subversion How to Use

From Go4IT project

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy

Svn / subversion tool (version control for source code)

Contents

Overview

Subversion (svn) is is an open source application which allows development teams to safely coordinate and track software source code changes: svn manages (track changes) data in files and directories, through a central repository, shared by distant users.


Subversion is designed specifically to be a modern replacement for CVS; for those who have experienced CVS, svn offers the same services with similar commands, but has some really news and powerful features.


Subversion is a client/server application.

The architecture is the following:

Subversion General Architecture

svn repository on Go4IT platform

The repository represents a file system tree. It is located at http://www.go4-it.eu/svnrepos/Go4IT and is organized as follow:

Go4IT Repository Tree

svn client for developers

You need to run a svn client on your local machine. The following are supported SVN clients:

   * TortoiseSVN (Graphical interface integrated with windows explorer), for Microsoft Windows.http://tortoisesvn.tigris.org/
   * The official SVN client (command line interface), included in most Linux and BSD distributions; available for Linux, BSD, Mac OS X, and Windows ...

Tortoise: getting started

TortoiseSVN is integrated in Windows Explorer for operations: the status of files and directories is shown by an icon directly set on the file or directory icon. A right clic in a directory shows a contextual pop up menu with the possible operations.

How to proceed:

  • 0. Create an empty directory (eg: Go4IT platform)
  • 1. Get the first copy of the repository (checkout)

right click on the "Go4IT platform" directory, and select the "SVN Checkout ..." menu item

TortoiseSVN Contextual Menu

Configure the URL of the repository as follow, and give the authentication data:

TortoiseSVN Checkout
TortoiseSVN Authentication

Remark: if you are not sure of what you are doing, the following adress can be used for test purposes: http://www.go4-it.eu/svnrepos/SandBox/

SVN copies the files from the distant repository to your Checkout directory:

TortoiseSVN Checkout Finished

The local working copy is created and svn status is shown directly on the icon (green: uptodate) + the possible current operations are listed in the contextual menu right click).

TortoiseSVN Contextual Menu and Icons
  • 2. Receive other's changes (update)

Chose SNV Update: you will receive the changes if any.

  • 3. Locally work on your copy (add, delete, copy, move, or modify a file)

TortoiseSVN shows the locally modified files status:

TortoiseSVN Local Copy Status
  • 4. and examine your changes (statuss, diff, revert):

Right click on a file, chose "Diff" in the "TortoiseSVN" menu

TortoiseSVN Diff Screen
  • 5. Locally merge other's changes if any (update, resolved)
  • 6. Publish your changes on the repository (commit)

Right clic in the directory, then Give a comment for the changes

TortoiseSVN Commit

SVN client lists the modified files, then send the files to the repository, and add 1 to the revision number of the repository:

TortoiseSVN End of Commit

svn client / command line

The command line client has the same features than the Turtoise one (with same names), but the advantage of being a command line utility. The complete command line tool is described in :The Subversion Command Line Client: svn

Anyway, to just get started, what you need is:

svn checkout --username <username> http://www.go4-it.eu/svnrepos/Go4IT

(It may be possible that the first time fails after entering the password. The secont time shall not ask for the password and work). Afterward, commands like add, up, etc. will just work.

This chapter of the book describes in details:

For a basic use:

  • svn add — Add files, directories, or symbolic links.
  • svn copy — Copy a file or directory in a working copy or in the repository.
  • svn mkdir — Create a new directory under version control.
  • svn delete — Delete an item from a working copy or the repository.
  • svn export — Export a clean directory tree.
  • svn import — Commit an unversioned file or tree into the repository.
  • svn move — Move a file or directory
  • svn diff — Display the differences between two paths.
  • svn merge — Apply the differences between two sources to a working copy path.
  • svn resolved — Remove “conflicted” state on working copy files or directories.
  • svn revert — Undo all local edits.
  • svn status — Print the status of working copy files and directories.
  • svn update — Update your working copy.
  • svn checkout — Check out a working copy from a repository.
  • svn commit — Send changes from your working copy to the repository.

See Also

Further reading:

Retrieved from "http://www.go4-it.eu/modules/mediawiki/index.php/Go4IT_forge:_Subversion_How_to_Use"

This page has been accessed 4,232 times. This page was last modified 10:17, 29 November 2006. Content is available under Go4IT project.


© 2005-2008 - Eu FP6 - INFRA 7 - Go4IT project