0059.html 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Apache Subversion Basics with TortoiseSVN</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  7. <script type="text/javascript">
  8. $(function(){
  9. $('textarea').each(function(i,e){
  10. theTextarea = $(this);
  11. theTextarea.height((theTextarea[0].scrollHeight-5) +'px');
  12. });
  13. $('li').each(function(i,e){
  14. var uuid = 'li_' + Math.floor(Math.random() * Math.floor(1000000)).toString() + '_' + i.toString();
  15. $(this).contents().wrap('<span id="'+ uuid +'"><label for="cb_'+ uuid +'"></label></span>');
  16. $(this).prepend('<input type="checkbox" class="completeBox" id="cb_' + uuid +'" rel="'+ uuid +'" />')
  17. });
  18. $('code,div.codeBlock,textarea.codeBlock').each(function(i,e){
  19. theElement = $(this);
  20. var lines = theElement.html().split("\n");
  21. theElement.empty();
  22. for(l=0;l<lines.length;l++){
  23. if($.trim(lines[l]) != '' && $.trim(lines[l]).substr(0,1) != '#' && $.trim(lines[l]).indexOf(' #') == -1 && lines[l].substr(0, 4).toUpperCase() != 'REM '){
  24. theElement.append('<input type="image" src="images/clipboard.png" value="" class="copy-text" rel="copy_'+ i +'_'+ l +'" data-clipboard-text="'+ lines[l].replace(/"/g, '&quot;') +'" /><span id="copy_'+ i +'_'+ l +'">'+ lines[l] +'</span>');
  25. } else {
  26. theElement.append(lines[l]);
  27. }
  28. }
  29. });
  30. $(document).on('click','input.copy-text',function(){
  31. theButton = $(this);
  32. $('input.copy-text').attr('src','images/clipboard.png');
  33. $('span.copy-animation,span.copy-animation-ps').removeClass('copy-animation copy-animation-ps');
  34. try {
  35. if($('#'+ theButton.attr('rel')).parent('div').hasClass('PS')){
  36. $('#'+ theButton.attr('rel')).addClass('copy-animation-ps');
  37. } else if($('#'+ theButton.attr('rel')).parent('div').hasClass('CMD')){
  38. $('#'+ theButton.attr('rel')).addClass('copy-animation-cmd');
  39. } else {
  40. $('#'+ theButton.attr('rel')).addClass('copy-animation');
  41. }
  42. navigator.clipboard.writeText(theButton.data('clipboard-text').replace(/<[^>]*>?/gm, ''));
  43. theButton.attr('src','images/clipboard_active.png');
  44. } catch(err) {
  45. }
  46. return false;
  47. });
  48. $(document).on('click','input.completeBox',function(){
  49. theBox = $(this);
  50. $('#'+ theBox.attr('rel')).addClass('strikethrough');
  51. theBox.prop('disabled',true);
  52. theBox.parent('li').prevAll().each(function(i,e){
  53. theLI = $(this);
  54. if(theLI.find('input[type=checkbox]').not(':checked')){
  55. $('#'+ theLI.find('input[type=checkbox]').attr('rel')).addClass('strikethrough');
  56. theLI.find('input[type=checkbox]').prop('checked',true).prop('disabled',true);
  57. }
  58. });
  59. });
  60. if(window.self !== window.top){
  61. window.parent.$('iframe.stepsFrame').height((this['scrollingElement']['scrollHeight']+20) +'px');
  62. }
  63. });
  64. </script>
  65. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  66. </head>
  67. <body>
  68. <div id="gridContainer">
  69. <div class="topMargin"></div>
  70. <div id="listName" class="topMargin">
  71. <h1>Apache Subversion Basics with TortoiseSVN</h1>
  72. </div>
  73. <div></div>
  74. <div id="content">
  75. <h2>Install&nbsp;TortoiseSVN</h2>
  76. <ol>
  77. <li>Download TortoiseSVN <a href="https://tortoisesvn.net/downloads.html" target="_blank">Download</a></li>
  78. <li>Install TortoiseSVN</li>
  79. </ol>
  80. <h2>Creating a New Repository</h2>
  81. <ol>
  82. <li>Navigate to where you are storing your Subversion repository databases</li>
  83. <li>Create a new folder matching the application name</li>
  84. <li>Inside the new folder, right click in the whitespace &gt; TortoiseSVN &gt; Create respository here</li>
  85. <li>When the dialog appears, click the Create folder structure option, this will create the standard &quot;trunk&quot;, &quot;branches&quot; and &quot;tags&quot; directories inside the new repository</li>
  86. </ol>
  87. <h2>Creating a Working Directory</h2>
  88. <ol>
  89. <li>Create a folder to contain the working copy of the code, this could be on a development web server</li>
  90. <li>Inside the new application folder, right click in the whitespace &gt; SVN Checkout...</li>
  91. <li>Input the URL&nbsp;to the repository to work with, this can be either a file:// or http(s)://&nbsp;URL if Apache HTTPD has been setup for Subversion (Video link: )<br />
  92. Examples:<br />
  93. file:///E:/SVN_Repos/new_code/trunk<br />
  94. https://svn.i12bretro.local/new_code/trunk</li>
  95. </ol>
  96. <h2>Committing Changes to the Repository</h2>
  97. <ol>
  98. <li>After completing code changes, right click in the white space of the working directory &gt; SVN Commit...</li>
  99. <li>Input <u>meaningful comments</u> about the changes completed</li>
  100. <li>Click OK</li>
  101. </ol>
  102. <h2>Importing Existing Code Into Subversion</h2>
  103. <ol>
  104. <li>Create the Subversion repository using the steps above</li>
  105. <li>Navigate to the folder that contains your code</li>
  106. <li>Right click in the whitespace &gt; TortoiseSVN &gt; Import...</li>
  107. <li>Input the URL&nbsp;to the repository to work with, this can be either a file:// or http(s)://&nbsp;URL if Apache HTTPD has been setup for Subversion (Video link: )<br />
  108. Examples:<br />
  109. file:///E:/SVN_Repos/import_code/trunk<br />
  110. http://svn.i12bretro.local/import_code/trunk</li>
  111. <li>Input a meaningful comment&nbsp;about the state of the code being imported</li>
  112. <li>To convert the current directory into a working directory after successfully importing the code into the repository, simply&nbsp;right click in the whitespace &gt; SVN Checkout...</li>
  113. <li>Input the&nbsp;URL&nbsp;to the repository to work with</li>
  114. <li>Verify the checkout path, making sure no unwanted sub-directories were added based on the repository URL (for example, I&#39;ve found that TortoiseSVN will add /trunk to the checkout directory)</li>
  115. <li>Click OK</li>
  116. <li>A dialog will display stating that the directory selected is not empty &gt; Confirm the target folder path and Click Checkout</li>
  117. </ol>
  118. <h2>Deploying Updates with Subversion Workflow</h2>
  119. <ol>
  120. <li>After completing development and testing the code, you&#39;ll be ready to deploy it to a production environment</li>
  121. <li>Navigate to the folder on the production environment &gt; Right click in the whitespace &gt; SVN Checkout...</li>
  122. <li>Input the URL&nbsp;to the repository to work with, this can be either a file:// or http(s)://&nbsp;URL if Apache HTTPD has been setup for Subversion<br />
  123. Examples:<br />
  124. file:///E:/SVN_Repos/import_code/trunk<br />
  125. https://svn.i12bretro.local/import_code/trunk</li>
  126. <li>After the checkout completes the production directory will contain an exact copy of code in&nbsp;/trunk of the repository</li>
  127. </ol>
  128. <h2>Relocating Subversion Repository</h2>
  129. <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>
  130. <ol>
  131. <li>Navigate to the working directory in Windows Explorer</li>
  132. <li>Right click in the white space&nbsp;&gt; TortoiseSVN &gt; Relocate...</li>
  133. <li>Input the URL&nbsp;to the new location of the matching repository<br />
  134. Examples:<br />
  135. file:///E:/SVN_Repos/import_code/trunk<br />
  136. https://svn.i12bretro.local/import_code/trunk</li>
  137. <li>A dialog stating the relocate succeeded should be displayed</li>
  138. <li>Right click in the white space &gt; TortoiseSVN &gt; Repo-browser</li>
  139. <li>The new updated URL should be displayed</li>
  140. </ol>
  141. <h2>Tagging Releases</h2>
  142. <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>
  143. <ol>
  144. <li>Right click in the whitespace anywhere in Windows</li>
  145. <li>Select TortoiseSVN &gt; Repo-browser</li>
  146. <li>Input the URL to the repository to work with</li>
  147. <li>Right click on the trunk folder in the left navigation pane &gt; Copy to...</li>
  148. <li>Input the URL to the new tag to create, for example&nbsp;http://svn.i12bretro.local/code_repo/tags/1.0</li>
  149. <li>Click OK</li>
  150. <li>Input a comment such as &quot;Creating v1.0 tag&quot; &gt; Click OK</li>
  151. <li>In the Repo browser, expand the tags directory to see the newly created tag</li>
  152. <li>To revert back to this version of the code, just use the tag URL when checking out into a working directory, for example&nbsp;http://svn.i12bretro.local/code_repo/tags/1.0</li>
  153. </ol>
  154. <h2>Include a directory in the repository, but ignore its contents</h2>
  155. <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>
  156. <ol>
  157. <li>Right click on the directory &gt; TortoiseSVN &gt; Properties</li>
  158. <li>Click the New... button &gt; Other</li>
  159. <li>Select svn:ignore from the Property name dropdown</li>
  160. <li>Type * in the Property value field</li>
  161. <li>Click OK</li>
  162. <li>Right click in the white space &gt; SVN Commit...</li>
  163. <li>Type a meaningful comment denoting the change</li>
  164. <li>Click OK</li>
  165. </ol>
  166. </div>
  167. </div>
  168. </body>
  169. </html>