SVN Tutorials

 

How to Add Solution to SubVersion:

 

Step1: (Set Working copy Root)

  • Start Visual studio (2005, 2008, 2010 or 2012).
  • Open or create new solution/project in Visual Studio.
  • Open SVN Menu and select command “Set Working Copy Root”, wizard will open.
  • It will by default pick the root folder, and check mark the option “Determine working copy root automatically”.
  • Press “Ok”. Now working copy folder is set in SVN, and all SVN commands will run on root directory.

Step2: (Add Solution to Subversion).

  • Open or create new solution in Visual Studio.
  • Select”Add Solution to Subversion” from the SVN menu and wizard will open.
  • Now select/type the repository URL, where your project code versions will be stored.
  • SVN adds your project files to a new or an existing repository.
  • All files included in the solution/project will be added to Subversion Repository.
  • Then Click Import to perform the file addition operation to subversion Repository.
  • Message will appear “Solution successfully added to subversion.”
  • After this operation is finished all source files and folders in your solution will be marked as added to Subversion Repository.
  • Added files will be indicated by yellow Dot in Solution Explorer.
  • But all changes are still local and have not been sent to the target Subversion repository yet.
  • Yellow Dot in Solution Explorer allows you to review the files/code of adding your solution to Subversion before the operation is finished.

Step 3

  • Go to SVN Menu and click on Commit to save the changes to Subversion repository.

SVN Menu

How to Get Solution from SubVersion:

Steps

  • Start Visual studio (2005, 2008, 2010 or 2012).
  • Then choose ‘Get Solution from Subversion’ from the VisualSVN menu command and the wizard will open.
  • Type the Repository URL, name of the project, set the location on your local system.
  • Click “OK”.
  • Enter Repository “User name & Password”. It will start downloading files from subversion repository.
  • Once completed a dialogue box will appear to open the downloaded solution files in Visual Studio.
  • All Files by default set to “Check Out Status”.

Check Out Status

SVN status:

SVN displays file status for all items in the Solution Explorer with traffic lights. There are only three status:

  • Green
    there are no changes, files could be same to latest revision.
  • Yellow
    When you edit any file, status change to yellow, and file is ready to commit on SVN repository
  • Red
    Status change to Red if there’s any conflicts or errors. So you need to revert the changes and resolve the error.

SVN Status

SVN Commands:

SVN has various commands and features, but we only use few of them on a day to day basis. Below are the few most common and useful commands.

Update:

This command will update the working copy and get latest version from subversion repository.

Commit:

This command will upload and save the changes and update version on repository.

SVN Commands

Show Changes:

Once you have finished with the changes, it’s a good idea to view the changes, before going to commit, go to svn menu and select “show changes”.

Disk – browser:

Explore the local disk where your project is stored.

Repo Browser:

Just as the explorer Repository Browser allows you to view the structure and status of the repository. It is recommended to open repo browser always and refresh it before going to commit and update to get an idea if any file is set to lock by any other user.

Pending changes Explorer:

Just under the solution explore another window open, which shows and track the current files need to be updated on subversion repository.

Get lock and Release lock:

Go to solution explorer, right click on the project, and scroll down and under svn menu click on the option Get lock/ Release lock, wizard will open where you can select files to set /release locks and press “OK”. It automatically commits the files to svn repository.

SVN Getlock

Revert:

This command can be used if any file status change to conflict/error while commit or upload. It will works in 2 ways. Revert back the changes to local files and update the revision from svn repository.

Key Features

kf_subversionSubversion (SVN) 1.7 kf_subversionRepository Browser kf_subversionWorking Copy kf_subversionResource History
Directory Browser Revision Graph Check Differences Detailed Author Info
Built-in Text Editors Resolving Conflicts Track Changes Subversion Properties
Revert Commit Update Merge