Linux:代码管理/SVN:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
创建页面,内容为“== 创建分支 == <blockquote><pre> svn cp -m "create branch" http://server/test/trunk http://server/test/branches/future</pre></blockquote> 获得分支 <blockqu…”
 
Kangkk​(留言 | 贡献)
 
(未显示同一用户的5个中间版本)
第1行: 第1行:
== 创建分支 ==
== 分支管理 ==
=== 查看仓库地址 ===
{{shc_out|<syntaxhighlight lang="bash">
svn info</syntaxhighlight>|<syntaxhighlight lang="javascript">
Path: .
Working Copy Root Path: /mnt/d/svn/herbvue
URL: svn://150.158.181.161/herbvue
Relative URL: ^/
Repository Root: svn://150.158.181.161/herbvue
Repository UUID: 99aa78c2-3c43-434b-a29c-a30dad64202d
Revision: 84
Node Kind: directory
Schedule: normal
Last Changed Author: kangkk
Last Changed Rev: 84
Last Changed Date: 2020-07-21 00:03:44 +0800 (Tue, 21 Jul 2020)
</syntaxhighlight>|$}}
 
创建分支
{{shc|<syntaxhighlight lang="bash">
svn cp -m "create branch"  svn://****/master  svn://****/master/kangkk
</syntaxhighlight>|$}}
 
获取分支
 
{{shc|<syntaxhighlight lang="bash">
svn co svn://****/master/kangkk</syntaxhighlight>|$}}
 
<blockquote><pre>
<blockquote><pre>
svn cp -m "create branch"  http://server/test/trunk http://server/test/branches/future</pre></blockquote>
svn merge [-r M:N] ^/trunk</pre></blockquote>
获得分支
 
<blockquote><pre>
同步主干的最新修改到当前工作副本,用于使分支跟主干保持同步
svn co http://server/test/branches/future</pre></blockquote>
 
合并主干上的最新代码到分支上
{{shc_out|<syntaxhighlight lang="bash">
<blockquote><pre>
pwd</syntaxhighlight>|<syntaxhighlight lang="bash">
svn merge http://server/test/trunk </pre></blockquote>
/mnt/d/svn/kangkk
</syntaxhighlight>|$}}
 
{{shc|<syntaxhighlight lang="bash">
svn merge svn://****/master/kangkk</syntaxhighlight>|$}}
 
分支合并到主干
分支合并到主干
<blockquote><pre>
 
svn merge --reintegrate http://server/test/branches/future</pre></blockquote>
{{shc_out|<syntaxhighlight lang="bash">
删该分支
pwd</syntaxhighlight>|<syntaxhighlight lang="bash">
<blockquote><pre>
/mnt/d/svn/master
svn rm  http://server/test/branches/future -m 'delete future'</pre></blockquote>
</syntaxhighlight>|$}}
 
{{shc|<syntaxhighlight lang="bash">
svn merge --reintegrate svn://****/master/kangkk</syntaxhighlight>|$}}
 
=== 删该分支 ===
 
{{shc|<syntaxhighlight lang="bash">
svn rm  svn://****/master/kangkk -m 'delete future'</syntaxhighlight>|$}}
 
 
{{shc|<syntaxhighlight lang="bash">
svn switch --relocate --username *** --password '***'  svn://1**.***.***.*61/herbvue  svn://15*.***.***.*61/kangkk</syntaxhighlight>|$}}
== 忽略文件 ==
 
== 参考==
* https://blog.csdn.net/matiji66/article/details/50624083
== error ==
* Source and destination URLs appear not to point to the same repository.
*: 源和目标URL似乎不指向同一个存储库

2020年9月26日 (六) 16:10的最新版本

分支管理

查看仓库地址

[jian@kang /home/kwy]$
svn info
Path: .
Working Copy Root Path: /mnt/d/svn/herbvue
URL: svn://150.158.181.161/herbvue
Relative URL: ^/
Repository Root: svn://150.158.181.161/herbvue
Repository UUID: 99aa78c2-3c43-434b-a29c-a30dad64202d
Revision: 84
Node Kind: directory
Schedule: normal
Last Changed Author: kangkk
Last Changed Rev: 84
Last Changed Date: 2020-07-21 00:03:44 +0800 (Tue, 21 Jul 2020)

创建分支

 
svn cp -m "create branch"  svn://****/master  svn://****/master/kangkk

获取分支

 
svn co svn://****/master/kangkk
svn merge [-r M:N] ^/trunk

同步主干的最新修改到当前工作副本,用于使分支跟主干保持同步

[jian@kang /home/kwy]$
pwd
/mnt/d/svn/kangkk
 
svn merge svn://****/master/kangkk

分支合并到主干

[jian@kang /home/kwy]$
pwd
/mnt/d/svn/master
 
svn merge --reintegrate svn://****/master/kangkk

删该分支

 
svn rm  svn://****/master/kangkk  -m 'delete future'


 
 svn switch --relocate --username *** --password '***'  svn://1**.***.***.*61/herbvue  svn://15*.***.***.*61/kangkk

忽略文件

参考

error

  • Source and destination URLs appear not to point to the same repository.
    源和目标URL似乎不指向同一个存储库