-
Notifications
You must be signed in to change notification settings - Fork 58
/
0059.html
140 lines (119 loc) · 7.41 KB
/
0059.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Apache Subversion Basics with TortoiseSVN</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="UTF-8">
<meta name="keywords" content="Subversion,Apache,TortoiseSVN,SVN,Source Code,Code Repository,Self-hosted,Basic Usage,Web Developer,Developer,System Administrator,Version Control,Source Control,Source Code Tracking,Self-Hosted,SVN Server,SVN Basics,Repository,Home Lab,Apache Subversion,Development,Free Software,Microsoft Windows,How To,Tutorial,i12bretro">
<meta name="author" content="i12bretro">
<meta name="description" content="Apache Subversion Basics with TortoiseSVN">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="revised" content="03/26/2022 01:00:07 PM" />
<link rel="icon" type="image/x-icon" href="includes/favicon.ico">
<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="includes/js/steps.js"></script>
<link href="css/steps.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="gridContainer">
<div class="topMargin"></div>
<div id="listName" class="topMargin">
<h1>Apache Subversion Basics with TortoiseSVN</h1>
</div>
<div></div>
<div id="content">
<h2>Install TortoiseSVN</h2>
<ol>
<li>Download TortoiseSVN <a href="https://tortoisesvn.net/downloads.html" target="_blank">Download</a></li>
<li>Install TortoiseSVN</li>
</ol>
<h2>Creating a New Repository</h2>
<ol>
<li>Navigate to where you are storing your Subversion repository databases</li>
<li>Create a new folder matching the application name</li>
<li>Inside the new folder, right click in the whitespace > TortoiseSVN > Create respository here</li>
<li>When the dialog appears, click the Create folder structure option, this will create the standard "trunk", "branches" and "tags" directories inside the new repository</li>
</ol>
<h2>Creating a Working Directory</h2>
<ol>
<li>Create a folder to contain the working copy of the code, this could be on a development web server</li>
<li>Inside the new application folder, right click in the whitespace > SVN Checkout...</li>
<li>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: )<br />
Examples:<br />
file:///E:/SVN_Repos/new_code/trunk<br />
https://svn.i12bretro.local/new_code/trunk</li>
</ol>
<h2>Committing Changes to the Repository</h2>
<ol>
<li>After completing code changes, right click in the white space of the working directory > SVN Commit...</li>
<li>Input <u>meaningful comments</u> about the changes completed</li>
<li>Click OK</li>
</ol>
<h2>Importing Existing Code Into Subversion</h2>
<ol>
<li>Create the Subversion repository using the steps above</li>
<li>Navigate to the folder that contains your code</li>
<li>Right click in the whitespace > TortoiseSVN > Import...</li>
<li>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: )<br />
Examples:<br />
file:///E:/SVN_Repos/import_code/trunk<br />
http://svn.i12bretro.local/import_code/trunk</li>
<li>Input a meaningful comment about the state of the code being imported</li>
<li>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...</li>
<li>Input the URL to the repository to work with</li>
<li>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)</li>
<li>Click OK</li>
<li>A dialog will display stating that the directory selected is not empty > Confirm the target folder path and Click Checkout</li>
</ol>
<h2>Deploying Updates with Subversion Workflow</h2>
<ol>
<li>After completing development and testing the code, you'll be ready to deploy it to a production environment</li>
<li>Navigate to the folder on the production environment > Right click in the whitespace > SVN Checkout...</li>
<li>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<br />
Examples:<br />
file:///E:/SVN_Repos/import_code/trunk<br />
https://svn.i12bretro.local/import_code/trunk</li>
<li>After the checkout completes the production directory will contain an exact copy of code in /trunk of the repository</li>
</ol>
<h2>Relocating Subversion Repository</h2>
<p>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</p>
<ol>
<li>Navigate to the working directory in Windows Explorer</li>
<li>Right click in the white space > TortoiseSVN > Relocate...</li>
<li>Input the URL to the new location of the matching repository<br />
Examples:<br />
file:///E:/SVN_Repos/import_code/trunk<br />
https://svn.i12bretro.local/import_code/trunk</li>
<li>A dialog stating the relocate succeeded should be displayed</li>
<li>Right click in the white space > TortoiseSVN > Repo-browser</li>
<li>The new updated URL should be displayed</li>
</ol>
<h2>Tagging Releases</h2>
<p>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</p>
<ol>
<li>Right click in the whitespace anywhere in Windows</li>
<li>Select TortoiseSVN > Repo-browser</li>
<li>Input the URL to the repository to work with</li>
<li>Right click on the trunk folder in the left navigation pane > Copy to...</li>
<li>Input the URL to the new tag to create, for example http://svn.i12bretro.local/code_repo/tags/1.0</li>
<li>Click OK</li>
<li>Input a comment such as "Creating v1.0 tag" > Click OK</li>
<li>In the Repo browser, expand the tags directory to see the newly created tag</li>
<li>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</li>
</ol>
<h2>Include a directory in the repository, but ignore its contents</h2>
<p>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.</p>
<ol>
<li>Right click on the directory > TortoiseSVN > Properties</li>
<li>Click the New... button > Other</li>
<li>Select svn:ignore from the Property name dropdown</li>
<li>Type * in the Property value field</li>
<li>Click OK</li>
<li>Right click in the white space > SVN Commit...</li>
<li>Type a meaningful comment denoting the change</li>
<li>Click OK</li>
</ol>
</div>
</div>
</body>
</html>