Creating SVN Repository using Tortoise SVN

Creating SVN Repository using Tortoise SVN

Using a versioning repository is an essiential part of web development process. Whether you are working with a team of developers or alone having copies of code stored by version history will save you at one point or another. This article will explain the basic usage of Tortoise SVN with an existing SVN repository. This article will not go over the initial repository setup.

To get started download and install the latest verison of Tortoise SVN.

Note: In this article we cover only Tortoise SVN installation for Windows.

Once installed Tortoise integrates with Windows Explorer. You will find new SVN options when right clicking on or in folders.

SVN Repository Vocabulary

Understanding some key words is important to the overal process. Some terms used are not all that obvious.

Import: To copy files into a repository

Export: To copy files out of a repository without version data. This is particularly useful when coping files from a repository to a production environment.

Checkout: To copy files out of a repository with version data. The inital checkout creates your working copy. This is to copy the code from the repository to the computer you use for developing the code.

Add: To mark new unversioned file(s) for upload to a repository. The files marked for addition will be uploaded on the next commit.

Commit: To copy files that have a modified date more recent than what is in the repository. Commit also perform actions previously indicated by various function like add, delete, move, rename, ...

Update: To copy files from that repository that have more recent changes than your local version

Importing your Code

There are two ways to get started with an existing repository. You will either be checking out the code from the repository or adding code from your local computer. For now we will assume you are working with an empty repository. Right click on the folder that contains your code and choose Import...

Creating SVN Repository using Tortoise SVN

Enter the repository's URL. This is usually going to look like https://svn.ingeniumweb.com/path/to/trunk/ and click OK. Depending on the authentication method setup for this repository you may be prompted for a login and password. Enter the login information and save the credentials to prevent being prompt each time.

Creating SVN Repository using Tortoise SVN

Checking Out the Head Version

If the repository has an existing code base or if you just imported your code you are ready to create a working copy by doing the initial checkout.

Choose a folder for your local copy to reside. Right click on the folder and choose SVN Checkout...

Creating SVN Repository using Tortoise SVN

Enter the repository URL. The Checkout Directory should match the folder you started with. Leave the defaults for Checkout Depth and Revision on this first checkout. Click OK.

Creating SVN Repository using Tortoise SVN

Now that you have a working copy you can develop your code as you normally would.

Committing Changes

You can use any IDE or editor for updating and adding files to your code. As you reach milestones in your development you should commit all changes back to the repository. When working with a team, others may have committed changes on the same files before you. SVN prevents you from writing over your team members work by prohibiting commits from an outdated working copy. If this happens you will need to update your copy and merge changes before doing your commit. The integration between windows explorer and Tortoise help you to determine if your code does not match the repository. You will see a green check box on a folder if everything in the folder is up-to-date.

You will see a red exclamation icon if you have files that contain uncommited changes. These icons also appear on the files themselves.

To commit your changes right click on or in the folder and choose SVN Commit...

Creating SVN Repository using Tortoise SVN

You will be presented with a list of files awaiting the commit. Uncheck any files you don't want to commit at this time. You can also add comments to explain what is being committed. Click the OK button to start the commit process.

To commit your changes right click on or in the folder and choose SVN Commit...

Creating SVN Repository using Tortoise SVN

Getting Files Back

When you need to bring back an old version of a file or simply replace files lost or damaged on your development computer the value of SVN really shines. Right click and move your mouse over TortoiseSVN then choose Update to revision...

Creating SVN Repository using Tortoise SVN

This dialog will open:

Creating SVN Repository using Tortoise SVN

From here click OK to get the latest revision back. Alternatively you can enter a revision number to obtain a certain version of the files. Click the Show Log button to help find the revisions you're looking for.

Creating SVN Repository using Tortoise SVN

Posted by Ingenium Web

Ingenium Web

iNGENIUM Ltd. is an software development company from EU which delivers a full range of custom .NET, web and mobile solutions for different business to meet partner's demand.

The Power of Imagination Makes Us Infinite

Related Posts

Comments

comments powered by Disqus