“svn命令大全”的版本间的差异

来自个人维基
跳转至: 导航搜索
第1行: 第1行:
 
<div class="content" style="padding: 0px; margin: 10px auto; font-family: Verdana,Arial,Helvetica,sans-serif; width: 900px; overflow: hidden; color: rgb(68, 68, 68); font-size: 14px; line-height: 25px;"><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">1、</strong>将文件checkout到本地目录</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;checkout</strong>&nbsp;path(path是服务器上的目录)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;checkout&nbsp;<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>://<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">192.168</span>.<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">1.1</span>/pro/domain<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;co</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">2、</strong>往版本库中添加新的文件</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;</strong><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">add</strong>&nbsp;file<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;add test.php(添加test.php)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;add *.php(添加当前目录下所有的php文件)</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">3、</strong>将改动的文件提交到版本库</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;commit</strong>&nbsp;-m “LogMessage“&nbsp;<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">[</span>-N<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">]</span>&nbsp;<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">[</span>--no-unlock<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">]</span>&nbsp;PATH...(如果选择了保持锁,就使用–no-unlock开关)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;commit -m “add test file for my test“ test.php<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;ci</font></p></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">4、</strong>加锁/解锁</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;lock</strong>&nbsp;-m “LockMessage“&nbsp;<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">[</span>--force<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">]</span>&nbsp;PATH...<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;lock -m “lock test file“ test.php<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;unlock</strong>&nbsp;PATH</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">5、</strong>更新到某个版本</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;update -r&nbsp;</strong>m path<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;update如果后面没有目录,默认将当前目录以及子目录下的所有文件都更新到最新版本。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;update -r 200 test.php(将版本库中的文件test.php还原到版本200)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;update test.php(更新,于版本库同步。如果在提交的时候提示过期的话,是因为<strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">冲突,需要先update,修改文件</strong>,然后清除<strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;resolved</strong>,最后再提交commit)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;up</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">6、</strong>查看文件或者目录状态</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4">1)<strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;status</strong>&nbsp;path...(目录下的文件和子目录的状态,正常状态不显示)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">【?:不在<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>的控制中;M:内容被修改;C:发生冲突;A:预定加入到版本库;K:被锁定】<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">2)<strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;status -v</strong>&nbsp;path...(显示文件和子目录状态)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">第一列保持相同,第二列显示工作版本号,第三和第四列显示最后一次修改的版本号和修改人。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">注:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;status、<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;diff和&nbsp;<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;revert这三条命令在没有网络的情况下也可以执行的,原因是<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>在本地的.<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>中保留了本地版本的原始拷贝。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;st</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">7、</strong>删除文件</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;delete</strong>&nbsp;path -m “delete test fle“<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;delete&nbsp;<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>://192.168.1.1/pro/domain/test.php -m “delete test file”<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">或者直接<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;delete test.php 然后再<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;ci -m ‘delete test file‘,推荐使用这种<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;(del, remove, rm)</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">8、</strong>查看日志</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;log</strong>&nbsp;path<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;log test.php 显示这个文件的所有修改记录,及其版本号的变化<br>另外可加参数,如"svn log -l 5"显示最近的5个更改日志</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">9、</strong>查看文件详细信息</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;info</strong>&nbsp;path<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;info test.php</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">10、</strong>比较差异</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;diff</strong>&nbsp;path(将修改的文件与基础版本比较)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;diff test.php<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;diff</strong>&nbsp;-r m:n path(对版本m和版本n比较差异)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;diff -r 200:201 test.php<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;di</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">11、</strong>将两个版本之间的差异合并到当前文件</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;merge -r</strong>&nbsp;m:n path<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;merge -r 200:205 test.php(将版本200与205之间的差异合并到当前文件,但是一般都会产生冲突,需要处理一下)</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">12、</strong><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">SVN</span>&nbsp;帮助</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;help<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;help ci</strong></font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4">——————————————————————————</font></p><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4">以上是常用命令,下面写几个不经常用的</font></p><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4">——————————————————————————</font></p><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">13、</strong>版本库下的文件和目录列表</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;list&nbsp;</strong>path<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">显示path目录下的所有属于版本库的文件和目录<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;ls</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">14、</strong>创建纳入版本控制下的新目录</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;mkdir</strong>: 创建纳入版本控制下的新目录。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">用法: 1、mkdir PATH…<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">2、mkdir URL…<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">创建版本控制的目录。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">1、每一个以工作副本 PATH 指定的目录,都会创建在本地端,并且加入新增<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">调度,以待下一次的提交。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">2、每个以URL指定的目录,都会透过立即提交于仓库中创建。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">在这两个情况下,所有的中间目录都必须事先存在。</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">15、</strong>恢复本地修改</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;revert</strong>: 恢复原始未改变的工作副本文件 (恢复大部份的本地修改)。revert:<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">用法: revert PATH…<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">注意: 本子命令不会存取网络,并且会解除冲突的状况。但是它不会恢复<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">被删除的目录</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">16、</strong>代码库URL变更</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;switch (sw):</strong>&nbsp;更新工作副本至不同的URL。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">用法: 1、switch URL [PATH]<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">2、switch –relocate FROM TO [PATH...]</font><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4">1、更新你的工作副本,映射到一个新的URL,其行为跟“<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;update”很像,也会将<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">服务器上文件与本地文件合并。这是将工作副本对应到同一仓库中某个分支或者标记的<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">方法。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">2、改写工作副本的URL元数据,以反映单纯的URL上的改变。当仓库的根URL变动<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">(比如方案名或是主机名称变动),但是工作副本仍旧对映到同一仓库的同一目录时使用<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">这个命令更新工作副本与仓库的对应关系。</font></p></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">17、</strong>解决冲突</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;resolved:</strong>&nbsp;移除工作副本的目录或文件的“冲突”状态。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">用法: resolved PATH…<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">注意: 本子命令不会依语法来解决冲突或是移除冲突标记;它只是移除冲突的<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">相关文件,然后让 PATH 可以再次提交。</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">18、</strong>输出指定文件或URL的内容。</font></p><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;</strong><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">cat</strong>&nbsp;目标[@版本]…如果指定了版本,将从指定的版本开始查找。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;cat -r PREV filename &gt; filename (PREV 是上一版本,也可以写具体版本号,这样输出结果是可以提交的)</span></font></div>
 
<div class="content" style="padding: 0px; margin: 10px auto; font-family: Verdana,Arial,Helvetica,sans-serif; width: 900px; overflow: hidden; color: rgb(68, 68, 68); font-size: 14px; line-height: 25px;"><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">1、</strong>将文件checkout到本地目录</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;checkout</strong>&nbsp;path(path是服务器上的目录)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;checkout&nbsp;<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>://<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">192.168</span>.<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">1.1</span>/pro/domain<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;co</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">2、</strong>往版本库中添加新的文件</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;</strong><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">add</strong>&nbsp;file<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;add test.php(添加test.php)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;add *.php(添加当前目录下所有的php文件)</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">3、</strong>将改动的文件提交到版本库</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;commit</strong>&nbsp;-m “LogMessage“&nbsp;<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">[</span>-N<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">]</span>&nbsp;<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">[</span>--no-unlock<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">]</span>&nbsp;PATH...(如果选择了保持锁,就使用–no-unlock开关)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;commit -m “add test file for my test“ test.php<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;ci</font></p></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">4、</strong>加锁/解锁</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;lock</strong>&nbsp;-m “LockMessage“&nbsp;<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">[</span>--force<span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold;">]</span>&nbsp;PATH...<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;lock -m “lock test file“ test.php<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;unlock</strong>&nbsp;PATH</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">5、</strong>更新到某个版本</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;update -r&nbsp;</strong>m path<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;update如果后面没有目录,默认将当前目录以及子目录下的所有文件都更新到最新版本。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;update -r 200 test.php(将版本库中的文件test.php还原到版本200)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;update test.php(更新,于版本库同步。如果在提交的时候提示过期的话,是因为<strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">冲突,需要先update,修改文件</strong>,然后清除<strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;resolved</strong>,最后再提交commit)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;up</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">6、</strong>查看文件或者目录状态</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4">1)<strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;status</strong>&nbsp;path...(目录下的文件和子目录的状态,正常状态不显示)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">【?:不在<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>的控制中;M:内容被修改;C:发生冲突;A:预定加入到版本库;K:被锁定】<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">2)<strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;status -v</strong>&nbsp;path...(显示文件和子目录状态)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">第一列保持相同,第二列显示工作版本号,第三和第四列显示最后一次修改的版本号和修改人。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">注:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;status、<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;diff和&nbsp;<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;revert这三条命令在没有网络的情况下也可以执行的,原因是<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>在本地的.<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>中保留了本地版本的原始拷贝。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;st</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">7、</strong>删除文件</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;delete</strong>&nbsp;path -m “delete test fle“<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;delete&nbsp;<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>://192.168.1.1/pro/domain/test.php -m “delete test file”<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">或者直接<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;delete test.php 然后再<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;ci -m ‘delete test file‘,推荐使用这种<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;(del, remove, rm)</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">8、</strong>查看日志</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;log</strong>&nbsp;path<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;log test.php 显示这个文件的所有修改记录,及其版本号的变化<br>另外可加参数,如"svn log -l 5"显示最近的5个更改日志</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">9、</strong>查看文件详细信息</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;info</strong>&nbsp;path<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;info test.php</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">10、</strong>比较差异</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;diff</strong>&nbsp;path(将修改的文件与基础版本比较)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;diff test.php<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;diff</strong>&nbsp;-r m:n path(对版本m和版本n比较差异)<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;diff -r 200:201 test.php<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;di</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">11、</strong>将两个版本之间的差异合并到当前文件</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;merge -r</strong>&nbsp;m:n path<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">例如:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;merge -r 200:205 test.php(将版本200与205之间的差异合并到当前文件,但是一般都会产生冲突,需要处理一下)</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">12、</strong><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">SVN</span>&nbsp;帮助</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;help<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;help ci</strong></font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4">——————————————————————————</font></p><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4">以上是常用命令,下面写几个不经常用的</font></p><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4">——————————————————————————</font></p><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">13、</strong>版本库下的文件和目录列表</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;list&nbsp;</strong>path<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">显示path目录下的所有属于版本库的文件和目录<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">简写:<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;ls</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">14、</strong>创建纳入版本控制下的新目录</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;mkdir</strong>: 创建纳入版本控制下的新目录。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">用法: 1、mkdir PATH…<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">2、mkdir URL…<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">创建版本控制的目录。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">1、每一个以工作副本 PATH 指定的目录,都会创建在本地端,并且加入新增<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">调度,以待下一次的提交。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">2、每个以URL指定的目录,都会透过立即提交于仓库中创建。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">在这两个情况下,所有的中间目录都必须事先存在。</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">15、</strong>恢复本地修改</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;revert</strong>: 恢复原始未改变的工作副本文件 (恢复大部份的本地修改)。revert:<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">用法: revert PATH…<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">注意: 本子命令不会存取网络,并且会解除冲突的状况。但是它不会恢复<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">被删除的目录</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">16、</strong>代码库URL变更</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;switch (sw):</strong>&nbsp;更新工作副本至不同的URL。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">用法: 1、switch URL [PATH]<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">2、switch –relocate FROM TO [PATH...]</font><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4">1、更新你的工作副本,映射到一个新的URL,其行为跟“<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;update”很像,也会将<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">服务器上文件与本地文件合并。这是将工作副本对应到同一仓库中某个分支或者标记的<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">方法。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">2、改写工作副本的URL元数据,以反映单纯的URL上的改变。当仓库的根URL变动<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">(比如方案名或是主机名称变动),但是工作副本仍旧对映到同一仓库的同一目录时使用<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">这个命令更新工作副本与仓库的对应关系。</font></p></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">17、</strong>解决冲突</font></p><div style="padding: 4px 5px 4px 4px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; border-right: 1px solid rgb(204, 204, 204); border-color: rgb(204, 204, 204); border-width: 1px; border-style: solid; font-size: 13px; width: 882px; color: rgb(0, 102, 102); background-color: rgb(238, 238, 238);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;resolved:</strong>&nbsp;移除工作副本的目录或文件的“冲突”状态。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">用法: resolved PATH…<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">注意: 本子命令不会依语法来解决冲突或是移除冲突标记;它只是移除冲突的<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">相关文件,然后让 PATH 可以再次提交。</font></div><p style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">18、</strong>输出指定文件或URL的内容。</font></p><font style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;" size="4"><span style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif; color: rgb(0, 102, 102);"><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;</strong><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">cat</strong>&nbsp;目标[@版本]…如果指定了版本,将从指定的版本开始查找。<br style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;"><span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span>&nbsp;cat -r PREV filename &gt; filename (PREV 是上一版本,也可以写具体版本号,这样输出结果是可以提交的)</span></font></div>
  
 +
'''关闭svn服务'''
 +
# killall svnserve
  
 
'''启动svn服务'''
 
'''启动svn服务'''

2023年1月4日 (三) 14:42的版本

1、将文件checkout到本地目录

svn checkout path(path是服务器上的目录)
例如:svn checkout svn://192.168.1.1/pro/domain
简写:svn co

2、往版本库中添加新的文件

svn add file
例如:svn add test.php(添加test.php)
svn add *.php(添加当前目录下所有的php文件)

3、将改动的文件提交到版本库

svn commit -m “LogMessage“ [-N] [--no-unlock] PATH...(如果选择了保持锁,就使用–no-unlock开关)
例如:svn commit -m “add test file for my test“ test.php
简写:svn ci

4、加锁/解锁

svn lock -m “LockMessage“ [--force] PATH...
例如:svn lock -m “lock test file“ test.php
svn unlock PATH

5、更新到某个版本

svn update -r m path
例如:
svn update如果后面没有目录,默认将当前目录以及子目录下的所有文件都更新到最新版本。
svn update -r 200 test.php(将版本库中的文件test.php还原到版本200)
svn update test.php(更新,于版本库同步。如果在提交的时候提示过期的话,是因为冲突,需要先update,修改文件,然后清除svn resolved,最后再提交commit)
简写:svn up

6、查看文件或者目录状态

1)svn status path...(目录下的文件和子目录的状态,正常状态不显示)
【?:不在svn的控制中;M:内容被修改;C:发生冲突;A:预定加入到版本库;K:被锁定】
2)svn status -v path...(显示文件和子目录状态)
第一列保持相同,第二列显示工作版本号,第三和第四列显示最后一次修改的版本号和修改人。
注:svn status、svn diff和 svn revert这三条命令在没有网络的情况下也可以执行的,原因是svn在本地的.svn中保留了本地版本的原始拷贝。
简写:svn st

7、删除文件

svn delete path -m “delete test fle“
例如:svn delete svn://192.168.1.1/pro/domain/test.php -m “delete test file”
或者直接svn delete test.php 然后再svn ci -m ‘delete test file‘,推荐使用这种
简写:svn (del, remove, rm)

8、查看日志

svn log path
例如:svn log test.php 显示这个文件的所有修改记录,及其版本号的变化
另外可加参数,如"svn log -l 5"显示最近的5个更改日志

9、查看文件详细信息

svn info path
例如:svn info test.php

10、比较差异

svn diff path(将修改的文件与基础版本比较)
例如:svn diff test.php
svn diff -r m:n path(对版本m和版本n比较差异)
例如:svn diff -r 200:201 test.php
简写:svn di

11、将两个版本之间的差异合并到当前文件

svn merge -r m:n path
例如:svn merge -r 200:205 test.php(将版本200与205之间的差异合并到当前文件,但是一般都会产生冲突,需要处理一下)

12、SVN 帮助

svn help
svn help ci

——————————————————————————

以上是常用命令,下面写几个不经常用的

——————————————————————————

13、版本库下的文件和目录列表

svn list path
显示path目录下的所有属于版本库的文件和目录
简写:svn ls

14、创建纳入版本控制下的新目录

svn mkdir: 创建纳入版本控制下的新目录。
用法: 1、mkdir PATH…
2、mkdir URL…
创建版本控制的目录。
1、每一个以工作副本 PATH 指定的目录,都会创建在本地端,并且加入新增
调度,以待下一次的提交。
2、每个以URL指定的目录,都会透过立即提交于仓库中创建。
在这两个情况下,所有的中间目录都必须事先存在。

15、恢复本地修改

svn revert: 恢复原始未改变的工作副本文件 (恢复大部份的本地修改)。revert:
用法: revert PATH…
注意: 本子命令不会存取网络,并且会解除冲突的状况。但是它不会恢复
被删除的目录

16、代码库URL变更

svn switch (sw): 更新工作副本至不同的URL。
用法: 1、switch URL [PATH]
2、switch –relocate FROM TO [PATH...]

1、更新你的工作副本,映射到一个新的URL,其行为跟“svn update”很像,也会将
服务器上文件与本地文件合并。这是将工作副本对应到同一仓库中某个分支或者标记的
方法。
2、改写工作副本的URL元数据,以反映单纯的URL上的改变。当仓库的根URL变动
(比如方案名或是主机名称变动),但是工作副本仍旧对映到同一仓库的同一目录时使用
这个命令更新工作副本与仓库的对应关系。

17、解决冲突

svn resolved: 移除工作副本的目录或文件的“冲突”状态。
用法: resolved PATH…
注意: 本子命令不会依语法来解决冲突或是移除冲突标记;它只是移除冲突的
相关文件,然后让 PATH 可以再次提交。

18、输出指定文件或URL的内容。

svn cat 目标[@版本]…如果指定了版本,将从指定的版本开始查找。
svn cat -r PREV filename > filename (PREV 是上一版本,也可以写具体版本号,这样输出结果是可以提交的)

关闭svn服务

# killall svnserve

启动svn服务

# svnserve -d -r /root/SVN/MySvnSever/

仓库备份
对于全量备份来说, 这个笨拙的方法看起来似乎很合理, 但是除非管理员 临时禁止对仓库的其他访问, 否则的话, 如果只是简单地复制目录, 得到的 备份也可能是有问题的. Berkeley DB 的文档描述了一种特定的数据库文件 复制顺序, 它可以保证得到的备份是有效的, 类似的复制顺序同样存在于 FSFS:

$ svnadmin hotcopy /var/svn/repos /var/svn/repos-backup

得到的备份是一个完整的 Subversion 仓库, 能够在原仓库出现故障时 顶替上去。


参考资料:
http://www.cnblogs.com/yecllsl/archive/2010/06/22/1762537.html

https://svnbook.red-bean.com/zh/1.8/svn.reposadmin.maint.html