﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-厚积薄发，滴水穿石-文章分类-工具</title><link>http://www.cppblog.com/cokecoffe/category/18435.html</link><description /><language>zh-cn</language><lastBuildDate>Sat, 31 Dec 2011 03:35:41 GMT</lastBuildDate><pubDate>Sat, 31 Dec 2011 03:35:41 GMT</pubDate><ttl>60</ttl><item><title>win下svn客户端安装与操作（转）</title><link>http://www.cppblog.com/cokecoffe/articles/svn.html</link><dc:creator>Wangkeke</dc:creator><author>Wangkeke</author><pubDate>Sat, 31 Dec 2011 02:53:00 GMT</pubDate><guid>http://www.cppblog.com/cokecoffe/articles/svn.html</guid><wfw:comment>http://www.cppblog.com/cokecoffe/comments/163242.html</wfw:comment><comments>http://www.cppblog.com/cokecoffe/articles/svn.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/cokecoffe/comments/commentRss/163242.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/cokecoffe/services/trackbacks/163242.html</trackback:ping><description><![CDATA[<div><p style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal; text-indent: 26px; background-color: #ffffff; "></p><div>转自http://jijian91.com/blog20061215/tortoisesvn.html<br /><strong>TortoiseSVN</strong>安装<br /> <br />&nbsp; &nbsp; &nbsp;可以从<u>http://tortoisesvn.tigris.org/</u>下载最新版，目前最新版是TortoiseSVN-1.5.6.14908。<br />下载后，安装。重启机器，使目录图标生效。<br />在资源管理器中，鼠标右键点击任意位置，右键菜单中出现&#8220;SVN Checkout&#8221;,即为安装成功。<br /><strong>svn操作流程</strong></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>开发人员使用svn进行开发的一般流程是：</div></div><div><div><strong>checkout</strong></div>（检出）项目</div><div><div>&#8212;&#8212;&gt; 更新文件或目录 &#8212;&#8212;&gt;<strong> update</strong></div></div><div><div>&#8212;&#8212;&gt; 修改文件或目录 &#8212;&#8212; <strong>commit</strong>(提交)变更</div></div><div><div>&#8212;&#8212;&gt; 增加文件或目录 &#8212;&#8212;&gt; <strong>add</strong>(增加) 文件或目录&#8212;&#8212;&gt; <strong>commit</strong>(提交)</div></div><div><div>&#8212;&#8212;&gt; 删除文件或目录 &#8212;&#8212;&gt; <strong>commit</strong>(提交)上一级目录</div></div><div><div>其中，checkout只进行一次，update、commit、add操作根据需要会经常使用。</div></div></blockquote><div><div><br /><strong>1.checkout(检出)</strong>操作</div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>&nbsp; &nbsp; &nbsp;在资源管理器中，鼠标右键点击任意位置，在菜单中选择&#8221;SVN Checkout&#8221;。</div></div><div><div>出现对话框，在&#8221;URL of repository:&#8221;中输入svn串，格式是&#8221;协议://ip:port/版本库/项目/目录&#8220;。根据实际情况输入，例如http://code.google.com/p/google-web-toolkit/source。如有疑问，向svn服务器管理员询问。</div></div><div><div>在&#8220;checkout directory&#8221;中输入本地存放代码的目录，请选择空目录或新目录。svn会清空该目录下的一切文件。输入完毕，点击&#8221;ok&#8221;按钮。</div></div><div><div>如果需要，会提示输入用户名和密码。选上&#8221;Save authentication&#8221;后，以后可以自动登录，不必重输密码。</div></div><div><div>checkout&#8230;有时候时间会很长。结束，点&#8221;ok&#8221;。</div></div></blockquote><div><div><br /><strong>2.update(更新)</strong>操作<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;在资源管理器中，选择本地目录或文件，鼠标右键菜单选择&#8221;SVN Update&#8221;。会提示有无文件需要更新，点&#8221;ok&#8221;完成。<br /><br /><strong>3.commit(提交)</strong>操作</div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;把本地目录中变化了的文件或目录提交到版本库中，用commit操作。增加新文件或目录，要先用add，再commit。删除文件或目录，commit上一级目录。</div></div><div><div>在资源管理器中，选择本地目录或文件，鼠标右键菜单选择&#8221;SVN Commit&#8221;。</div></div><div><div>显示分上下2个框的界面。在上框输入说明文字，建议写版本号或变更原因，以便将来查找。下框列出提交的内容。没有可提交的内容，下框中会显示一段说明文字。点&#8220;ok&#8221;。</div></div><div><div>提交结束，显示结果。点&#8220;ok&#8221;。</div></div></blockquote><div><div><u>解决代码冲突</u></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>如果commit时出现&#8220;You have to update your work copy first.&#8221;红色警告，说明版本库中的此文件已经被其他人修改了。请先点&#8220;ok&#8221;按钮退出。执行update,然后再commit。</div></div><div><div>如果修改与update得到的代码不冲突，则自动合并。如果冲突（比如对同一行代码进行了修改），则出现&#8221;One or more files are in a conflicted state.&#8220;红色警告，并产生几个文件记录冲突。一般情况下，我们不要直接编辑冲突文件。而按照以下操作手工解决冲突。</div></div><div><div>在资源管理器中，选择commit时冲突的那个文件，鼠标右键菜单选择&#8221;Edit conficts&#8221;。</div></div><div><div>出现界面，分为&#8221;Theirs&#8221;、&#8221;Mine&#8221;和&#8221;Merged&#8221;3部分，表示&#8221;别人修改的内容&#8221;、 &#8221;我修改的内容&#8221;和&#8221;合并后的结果&#8221;3部分。我们是要将&#8221;别人修改的内容&#8221;和&#8221;我修改的内容&#8221;有取舍地合并起来，形成&#8221;合并后的结果&#8221;。</div></div><div><div>合并一般分为4种情况：</div></div><div><div>保留&#8221;我的修改&#8221;,舍弃&#8221;别人的修改&#8221;。鼠标右键点击Mine框的相应行，点击&#8221;Use this text block&#8221;。</div></div><div><div>舍弃&#8221;我的修改&#8221;,保留&#8221;别人的修改&#8221;。鼠标右键点击Theirs框的相应行，点击&#8221;Use this text block&#8221;。</div></div><div><div>同时保留&#8221;我的修改&#8221;和&#8221;别人的修改&#8221;，并将&#8221;我的修改&#8221; 放在前面。鼠标右键点击Mine框的相应行，点击&#8221;Use text block from mine before theirs&#8221;。</div></div><div><div>同时保留&#8221;我的修改&#8221;和&#8221;别人的修改&#8221;，并将&#8221;别人的修改&#8221;放在前面。鼠标右键点击Mine框的相应行，点击&#8221;Use text block from theirs before mine&#8221;。</div></div><div><div>合并完成，Ctrl+S存盘，退出。</div></div><div><div>然后，在资源管理器中，选择冲突文件，鼠标右键菜单选择&#8221;Resolved&#8221;,标记冲突已解决。系统会自动删除因冲突而新建的文件。此时，就可以继续进行commit操作了。</div></div></blockquote><div><div><strong><br />4.add(增加)</strong>操作</div></div><blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><div><div>&nbsp; &nbsp; &nbsp; 增加新文件或目录，要先用add，再commit。</div></div><div><div>在资源管理器中，选择新增的目录或文件，鼠标右键菜单选择&#8221;Add&#8221;。</div></div><div><div>提示增加的文件。点&#8220;ok&#8221;继续。结束点&#8220;ok&#8221;。</div></div></blockquote><div><div><strong><br />5.delete(删除)</strong>操作</div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>&nbsp; &nbsp; &nbsp; 删除文件或目录，commit上一级目录。</div></div></blockquote><img src ="http://www.cppblog.com/cokecoffe/aggbug/163242.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cokecoffe/" target="_blank">Wangkeke</a> 2011-12-31 10:53 <a href="http://www.cppblog.com/cokecoffe/articles/svn.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>