{"id":383,"date":"2009-02-07T00:26:17","date_gmt":"2009-02-07T05:26:17","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=383"},"modified":"2010-03-19T14:20:39","modified_gmt":"2010-03-19T19:20:39","slug":"svn","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=383","title":{"rendered":"Subversion (SVN)"},"content":{"rendered":"<span id=\"Install_SVN_1.5\"><h3>Install SVN 1.5<\/h3><\/span>\n<p>*Download and unzip Subversion 1.5 binary built for Apache 2.2 (svn-win32-1.5.5.zip) from <a href=\"http:\/\/subversion.tigris.org\/servlets\/ProjectDocumentList?folderID=8100\">here<\/a><br \/>\n*Create a new env variable: SVN_HOME=C:\\prog\\svn-win32-1.5.5<br \/>\n*Add %SVN_HOME%\\bin to PATH: path=%SVN_HOME%\\bin;%path%<\/p>\n<pre>\r\nSVN_HOME=C:\\prog\\svn-win32-1.5.5\r\npath=%SVN_HOME%\\bin;%path%\r\n<\/pre>\n<span id=\"Create_Repository\"><h3>Create Repository<\/h3><\/span>\n<pre>svnadmin create C:\\work\\svn<\/pre>\n<span id=\"Eclipse_plugin:_Subclipse_\"><h3>Eclipse plugin: Subclipse <\/h3><\/span>\n<p>* Eclipse update site URL: http:\/\/subclipse.tigris.org\/update_1.4.x<br \/>\n* Install all<br \/>\n* Restart Eclipse<br \/>\n* Open SVN Perspective: SVN Repository Exploring. Add a SVN Repository location.<br \/>\n* Right click an Eclipse project, select the Team menu for SVN operations.<\/p>\n<span id=\"Install_SVN_on_Apache_2\"><h3>Install SVN on Apache 2<\/h3><\/span>\n<p>* See <a href=\"?p=270\">here <\/a>for details.<\/p>\n<span id=\"Remove_all_subversion_directories\"><h3>Remove all subversion directories<\/h3><\/span>\n<p>Sometimes you want to remove a directory structure from subversion control. Simple remove all .svn folders. You can also use the following Ant target to do that. Important note is that you need to set defaultexcludes to false since .svn is one of the default excludes for Ant.<\/p>\n<pre lang=\"xml\">\r\n  <!-- - - - - - - - - - - - - - - - - - \r\n          target: remove-svn                      \r\n         - - - - - - - - - - - - - - - - - -->\r\n    <target name=\"remove-svn\">\r\n      <delete includeemptydirs=\"true\">\r\n      <fileset dir=\"${basedir}\" defaultexcludes=\"false\">\r\n          <include name=\"**\/.svn\/**\"\/>\r\n      <\/fileset>\r\n    <\/delete>\r\n    <\/target>\r\n<\/pre>\n<span id=\"Repository_Access_URLs\"><h3>Repository Access URLs<\/h3><\/span>\n<pre>file:\/\/\/\r\nfile:\/\/\/x:\/path\/to\/repos\r\nhttp:\/\/\r\nhttps:\/\/\r\nsvn:\/\/\r\nsvn+ssh:\/\/\r\n<\/pre>\n<span id=\"Commands\"><h3>Commands<\/h3><\/span>\n<span id=\"Help\"><h4>Help<\/h4><\/span>\n<pre>svn help <subcommand><\/pre>\n<span id=\"Create_a_repository\"><h4>Create a repository<\/h4><\/span>\n<pre>svnadmin create C:\\svn\\repos1<\/pre>\n<span id=\"List\"><h4>List<\/h4><\/span>\n<pre>svn list file:\/\/\/c:\/svn\/repos1<\/pre>\n<span id=\"Import\"><h4>Import<\/h4><\/span>\n<p>* Create directory structure to be imported.<\/p>\n<pre>project\r\n-trunk\r\n--mydir\r\n---myfile.txt\r\n-tags\r\n-branches<\/pre>\n<p>* Go to project&#8217;s parent directory and issue import command:<\/p>\n<pre>svn import project file:\/\/\/c:\/svn\/repos1\/project1 -m \"Initial import of my project\"\r\nAdding         project\\trunk\r\nAdding         project\\trunk\\mydir\r\nAdding         project\\trunk\\mydir\\myfile.txt\r\nAdding         project\\branches\r\nAdding         project\\tags\r\n\r\nCommitted revision 1.\r\n<\/pre>\n<span id=\"Checkout_project\"><h4>Checkout project<\/h4><\/span>\n<pre>svn checkout file:\/\/\/c:\/svn\/repos1\/project1\/trunk\/mydir\r\nA    mydir\\myfile.txt\r\nChecked out revision 1.<\/pre>\n<span id=\"Checkout_a_particular_revision\"><h4>Checkout a particular revision<\/h4><\/span>\n<pre>svn checkout --revision 1 file:\/\/\/c:\/svn\/repos1\/project1\/trunk\r\nA    trunk\\mydir\r\nA    trunk\\mydir\\myfile.txt\r\nChecked out revision 1.<\/pre>\n<span id=\"Update_file\"><h4>Update file<\/h4><\/span>\n<pre>svn update<\/pre>\n<span id=\"Update_to_a_particular_revision\"><h4>Update to a particular revision<\/h4><\/span>\n<pre>svn update --revision 2\r\nU    mydir\\myfile.txt\r\nUpdated to revision 2.<\/pre>\n<span id=\"Commit_modified_file\"><h4>Commit modified file<\/h4><\/span>\n<p>* Modify myfile.txt.<br \/>\n* Under mydir directory:<\/p>\n<pre>svn commit -m \"Modified myfile.txt\"\r\nSending        myfile.txt\r\nTransmitting file data .\r\nCommitted revision 2.<\/pre>\n<span id=\"View_log\"><h4>View log<\/h4><\/span>\n<pre>svn log myfile.txt\r\n------------------------------------------------------------------------\r\nr1 | JianmingLi | 2009-04-20 13:41:43 -0400 (Mon, 20 Apr 2009) | 1 line\r\n\r\nInitial import of my project\r\n------------------------------------------------------------------------\r\n\r\nC:\\Temp\\svnwork\\mydir>svn log myfile.txt\r\n------------------------------------------------------------------------\r\nr2 | JianmingLi | 2009-04-20 14:09:25 -0400 (Mon, 20 Apr 2009) | 1 line\r\n\r\nModified myfile.txt\r\n------------------------------------------------------------------------\r\nr1 | JianmingLi | 2009-04-20 13:41:43 -0400 (Mon, 20 Apr 2009) | 1 line\r\n\r\nInitial import of my project\r\n------------------------------------------------------------------------\r\n\r\nsvn log --revision 1:2\r\nsvn log -r 1:2\r\n<\/pre>\n<span id=\"Add_a_new_file_to_repository\"><h4>Add a new file to repository<\/h4><\/span>\n<p>* Create a new file in mydir directory.<br \/>\n* In mydir directory:<\/p>\n<pre>svn add addfile.txt\r\nA         addfile.txt\r\n\r\nsvn commit -m \"Add addfile.txt\"\r\nAdding         addfile.txt\r\nTransmitting file data .\r\nCommitted revision 3.<\/pre>\n<span id=\"Add_all_new_files\"><h4>Add all new files<\/h4><\/span>\n<pre>svn add * --force<\/pre>\n<span id=\"Copy_file\"><h4>Copy file<\/h4><\/span>\n<p>* In mydir directory:<\/p>\n<pre>svn copy addfile.txt copyfile.txt\r\nA         copyfile.txt\r\n\r\nsvn commit -m \"Copy addfile to copyfile.txt\"\r\nAdding         copyfile.txt\r\n\r\nCommitted revision 4.<\/pre>\n<span id=\"Delete_file\"><h4>Delete file<\/h4><\/span>\n<pre>\r\nsvn delete addfile.txt\r\nD         addfile.txt\r\n\r\nsvn commit -m \"Delete addfile\"\r\nDeleting       addfile.txt\r\n\r\nCommitted revision 5.<\/pre>\n<span id=\"Diff_file\"><h4>Diff file<\/h4><\/span>\n<pre>C:\\Temp\\svnwork\\mydir>svn diff myfile.txt\r\nIndex: myfile.txt\r\n=========================================\r\n--- myfile.txt  (revision 2)\r\n+++ myfile.txt  (working copy)\r\n@@ -1 +1 @@\r\n-modified text.\r\n\\ No newline at end of file\r\n+modified text. modified again.\r\n\\ No newline at end of file<\/pre>\n<span id=\"Revert_changes\"><h4>Revert changes<\/h4><\/span>\n<pre>\r\nsvn revert myfile.txt\r\nReverted 'myfile.txt'\r\n\r\nsvn diff myfile.txt<\/pre>\n<span id=\"Print_out_a_particular_revision\"><h4>Print out a particular revision<\/h4><\/span>\n<pre>\r\nsvn cat --revision 1 myfile.txt\r\ninitial text.\r\nsvn cat --revision 2 myfile.txt\r\nmodified text.<\/pre>\n<span id=\"List_repository_files\"><h4>List repository files<\/h4><\/span>\n<pre>\r\nsvn list file:\/\/\/c:\/svn\/repos1\/project1\/trunk\r\nmydir\/\r\n\r\nsvn list file:\/\/\/c:\/svn\/repos1\/project1\/trunk\/mydir\r\ncopyfile.txt\r\nmyfile.txt<\/pre>\n<span id=\"Cleanup_work_directory\"><h4>Cleanup work directory<\/h4><\/span>\n<pre>svn cleanup\r\n<\/pre>\n<span id=\"Backup_repository\"><h4>Backup repository<\/h4><\/span>\n<pre>svnadmin hotcopy path\/to\/repo path\/to\/backup --clean-logs\r\n<\/pre>\n<p>References<br \/>\n<a href=\"http:\/\/abbeyworkshop.com\/howto\/misc\/svn01\/\">SVN cheat sheet<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Install SVN 1.5 *Download and unzip Subversion 1.5 binary built for Apache 2.2 (svn-win32-1.5.5.zip) from here *Create a new env variable: SVN_HOME=C:\\prog\\svn-win32-1.5.5 *Add %SVN_HOME%\\bin to PATH: path=%SVN_HOME%\\bin;%path% SVN_HOME=C:\\prog\\svn-win32-1.5.5 path=%SVN_HOME%\\bin;%path% Create Repository svnadmin create C:\\work\\svn Eclipse plugin: Subclipse * Eclipse update &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=383\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[36,67,10],"tags":[],"class_list":["post-383","post","type-post","status-publish","format-standard","hentry","category-scm","category-svn","category-winos"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s8cRUO-svn","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=383"}],"version-history":[{"count":17,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/383\/revisions"}],"predecessor-version":[{"id":1482,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/383\/revisions\/1482"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}