469
查看svn命令大全的源代码
svn命令大全
0
←
svn命令大全
跳转至:
导航
、
搜索
因为以下原因,你没有权限编辑本页:
你被禁止执行你刚才请求的操作。
您可以查看并复制此页面的源代码:
<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> checkout</strong> 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> checkout <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> 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> </strong><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">add</strong> 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> 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> 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> commit</strong> -m “LogMessage“ <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> <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> 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> 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> 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> lock</strong> -m “LockMessage“ <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> 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> 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> unlock</strong> 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> update -r </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> 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> 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> 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> 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> 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> status</strong> 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> status -v</strong> 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> status、<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span> diff和 <span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span> 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> 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> delete</strong> 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> delete <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> delete test.php 然后再<span class="highlight" style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">svn</span> 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> (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> log</strong> 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> 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> info</strong> 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> 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> diff</strong> 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> 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> diff</strong> -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> 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> 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> merge -r</strong> 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> 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> 帮助</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> 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> 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> list </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> 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> 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> 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> switch (sw):</strong> 更新工作副本至不同的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> 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> resolved:</strong> 移除工作副本的目录或文件的“冲突”状态。<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> </strong><strong style="padding: 0px; margin: 0px; font-family: Verdana,Arial,Helvetica,sans-serif;">cat</strong> 目标[@版本]…如果指定了版本,将从指定的版本开始查找。<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> cat -r PREV filename > filename (PREV 是上一版本,也可以写具体版本号,这样输出结果是可以提交的)</span></font></div> '''启动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
返回
svn命令大全
。
导航菜单
个人工具
   
个人维基
注册
登录
名字空间
页面
变换
查看
阅读
查看源代码
统计
查看历史
操作
搜索
导航
首页
Ubuntu
Android
C&CPP
Java
Python
大杂烩
最近更改
工具箱
所有页面
文件列表
特殊页面