Install TortoiseSVN
Download TortoiseSVN Download
Install TortoiseSVN
Creating a New Repository
Navigate to where you are storing your Subversion repository databases
Create a new folder matching the application name
Inside the new folder, right click in the whitespace > TortoiseSVN > Create respository here
When the dialog appears, click the Create folder structure option, this will create the standard "trunk", "branches" and "tags" directories inside the new repository
Creating a Working Directory
Create a folder to contain the working copy of the code, this could be on a development web server
Inside the new application folder, right click in the whitespace > SVN Checkout...
Input the URL to the repository to work with, this can be either a file:// or http(s):// URL if Apache HTTPD has been setup for Subversion (Video link: )
Examples:
file:///E:/SVN_Repos/new_code/trunk
https://svn.i12bretro.local/new_code/trunk
Committing Changes to the Repository
After completing code changes, right click in the white space of the working directory > SVN Commit...
Input meaningful comments about the changes completed
Click OK
Importing Existing Code Into Subversion
Create the Subversion repository using the steps above
Navigate to the folder that contains your code
Right click in the whitespace > TortoiseSVN > Import...
Input the URL to the repository to work with, this can be either a file:// or http(s):// URL if Apache HTTPD has been setup for Subversion (Video link: )
Examples:
file:///E:/SVN_Repos/import_code/trunk
http://svn.i12bretro.local/import_code/trunk
Input a meaningful comment about the state of the code being imported
To convert the current directory into a working directory after successfully importing the code into the repository, simply right click in the whitespace > SVN Checkout...
Input the URL to the repository to work with
Verify the checkout path, making sure no unwanted sub-directories were added based on the repository URL (for example, I've found that TortoiseSVN will add /trunk to the checkout directory)
Click OK
A dialog will display stating that the directory selected is not empty > Confirm the target folder path and Click Checkout
Deploying Updates with Subversion Workflow
After completing development and testing the code, you'll be ready to deploy it to a production environment
Navigate to the folder on the production environment > Right click in the whitespace > SVN Checkout...
Input the URL to the repository to work with, this can be either a file:// or http(s):// URL if Apache HTTPD has been setup for Subversion
Examples:
file:///E:/SVN_Repos/import_code/trunk
https://svn.i12bretro.local/import_code/trunk
After the checkout completes the production directory will contain an exact copy of code in /trunk of the repository
Relocating Subversion Repository
This is useful if the location (file path or URL) of the repository has changed but the repository remains the same. For example, migrating to a new server or from file paths to Apache HTTPD based URLs
Navigate to the working directory in Windows Explorer
Right click in the white space > TortoiseSVN > Relocate...
Input the URL to the new location of the matching repository
Examples:
file:///E:/SVN_Repos/import_code/trunk
https://svn.i12bretro.local/import_code/trunk
A dialog stating the relocate succeeded should be displayed
Right click in the white space > TortoiseSVN > Repo-browser
The new updated URL should be displayed
Tagging Releases
Once development and testing are completed for a version of the code, you can create a tag in Subversion. This is a snapshot of the code set and can we used to roll back to the exact version in the future if needed
Right click in the whitespace anywhere in Windows
Select TortoiseSVN > Repo-browser
Input the URL to the repository to work with
Right click on the trunk folder in the left navigation pane > Copy to...
Input the URL to the new tag to create, for example http://svn.i12bretro.local/code_repo/tags/1.0
Click OK
Input a comment such as "Creating v1.0 tag" > Click OK
In the Repo browser, expand the tags directory to see the newly created tag
To revert back to this version of the code, just use the tag URL when checking out into a working directory, for example http://svn.i12bretro.local/code_repo/tags/1.0
Include a directory in the repository, but ignore its contents
This scenario is useful for a directory that is required by the application but where the contents is unique to the deployment. For example, an upload, temp, log or attachment directory.
Right click on the directory > TortoiseSVN > Properties
Click the New... button > Other
Select svn:ignore from the Property name dropdown
Type * in the Property value field
Click OK
Right click in the white space > SVN Commit...
Type a meaningful comment denoting the change
Click OK