{"id":63,"date":"2009-05-11T11:42:47","date_gmt":"2009-05-11T11:42:47","guid":{"rendered":"http:\/\/nicholshayes.myzen.co.uk\/blog\/?p=63"},"modified":"2009-05-11T11:43:15","modified_gmt":"2009-05-11T11:43:15","slug":"ignore-files-and-folders-via-tortoisesvn","status":"publish","type":"post","link":"http:\/\/nicholshayes.co.uk\/blog\/?p=63","title":{"rendered":"Ignore files and folders via TortoiseSVN"},"content":{"rendered":"<p><strong>Why ignore?<\/strong><br \/>\nIgnoring a file or folder from the Subversion system can reduce a lot of complexity from the repository. For example, if you edit your code via NetBeans, you probably don&#8217;t want to version control the .nbproject folder it puts into the root of your application. Also you probably don&#8217;t want to version logs (that caused me a big headache on my first Rails application as I found I was version controlling a very large (gig!) development.log file after I made a looping error)<\/p>\n<p><strong>Ignoring new items<\/strong><br \/>\nIt is very easy to ignore new items using TortoiseSVN. Simply right click on the object (file or folder) and select:<\/p>\n<pre>\r\nTortoiseSVN > 'Add to ignore list'\r\n<\/pre>\n<p>and select the object name presented. Job done.<\/p>\n<p><strong>Editing the result<\/strong><br \/>\nYou can edit the result by right clicking on the object&#8217;s containing folder and selecting<\/p>\n<pre>\r\nTortoiseSVN > Properties\r\n<\/pre>\n<p>You should see a line in the properties showing the ignore statement that has been added. Click on the Edit button to have a closer look:<br \/>\n<div id=\"attachment_65\" style=\"width: 584px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-65\" decoding=\"async\" loading=\"lazy\" src=\"http:\/\/nicholshayes.myzen.co.uk\/blog\/wp-content\/uploads\/2009\/05\/svn_properties.png\" alt=\"Details of SVN properties showing an ignore example\" title=\"SVN Properties\" width=\"574\" height=\"438\" class=\"size-full wp-image-65\" srcset=\"http:\/\/nicholshayes.co.uk\/blog\/wp-content\/uploads\/2009\/05\/svn_properties.png 574w, http:\/\/nicholshayes.co.uk\/blog\/wp-content\/uploads\/2009\/05\/svn_properties-300x228.png 300w\" sizes=\"(max-width: 574px) 100vw, 574px\" \/><p id=\"caption-attachment-65\" class=\"wp-caption-text\">Details of SVN properties showing an ignore example<\/p><\/div><br \/>\nNote that each pattern being ignored has its own line. If you wanted to add the &#8216;log&#8217; folder, you could just add a new line with the word log in it. You can also use the * character to add filed cards. For example, if you add<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">svn:ignore *<\/div><\/div>\n<p>to the log folder, the folder itself will be versioned, but not its contents.<\/p>\n<p><strong>Where to ignore<\/strong><br \/>\nI&#8217;ve found it is best to ignore at the level of the containing folder. So if you had a file upload system that stored files in public\/file_upload and you wanted to ignore that folder: the best policy is to add an<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">svn:ignore file_upload<\/div><\/div>\n<p>to the public folder and NOT try to<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">svn:ignore public\/file_upload<\/div><\/div>\n<p>at the application root.<\/p>\n<p><strong>Recursive<\/strong><br \/>\nAlso be very careful of your use of the &#8220;Apply property recursively&#8221; option. Selecting this option will over-write the ignore list in all sub-folders so use with caution. In most cases you should not select this option.<\/p>\n<p><strong>Ignoring object already in the repository<\/strong><br \/>\nYou may well find that you have to retrospectively ignore an object because the object is versioned before you realise that it would be better to ignore it. I didn&#8217;t find it immediately obvious how to do this.<\/p>\n<p>TortoiseSVN does not allow you to use the methods described above to ignore an object that is already in repository. You have to remove the object from the repository first. <em>Do not use the delete option in the TortoiseSVN right click menu as this will remove the object from the repository AND delete the object itself.<\/em> Instead use the Repository browser to delete the object from the repository directly.<\/p>\n<pre>\r\nToirtoiseSVN > Repo-Browser\r\n<\/pre>\n<p>Then within the Repository browser right click on the object and select Delete.<\/p>\n<p>Once the object is removed from the repository, the ignore options become available in the TortoiseSVN right click menu.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why ignore? Ignoring a file or folder from the Subversion system can reduce a lot of complexity from the repository. For example, if you edit your code via NetBeans, you probably don&#8217;t want to version control the .nbproject folder it &hellip; <a href=\"http:\/\/nicholshayes.co.uk\/blog\/?p=63\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"http:\/\/nicholshayes.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/63"}],"collection":[{"href":"http:\/\/nicholshayes.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nicholshayes.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nicholshayes.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/nicholshayes.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=63"}],"version-history":[{"count":13,"href":"http:\/\/nicholshayes.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/63\/revisions"}],"predecessor-version":[{"id":77,"href":"http:\/\/nicholshayes.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/63\/revisions\/77"}],"wp:attachment":[{"href":"http:\/\/nicholshayes.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=63"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nicholshayes.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=63"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nicholshayes.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=63"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}