中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

SVN 分支


Branch 選項(xiàng)會(huì)給開發(fā)者創(chuàng)建出另外一條線路。當(dāng)有人希望開發(fā)進(jìn)程分開成兩條不同的線路時(shí),這個(gè)選項(xiàng)會(huì)非常有用。

比如項(xiàng)目 demo 下有兩個(gè)小組,svn 下有一個(gè) trunk 版。

由于客戶需求突然變化,導(dǎo)致項(xiàng)目需要做較大改動(dòng),此時(shí)項(xiàng)目組決定由小組 1 繼續(xù)完成原來正進(jìn)行到一半的工作(某個(gè)模塊),小組 2 進(jìn)行新需求的開發(fā)。

那么此時(shí),我們就可以為小組2建立一個(gè)分支,分支其實(shí)就是 trunk 版(主干線)的一個(gè)copy版,不過分支也是具有版本控制功能的,而且是和主干線相互獨(dú)立的,當(dāng)然,到最后我們可以通過(合并)功能,將分支合并到 trunk 上來,從而最后合并為一個(gè)項(xiàng)目。

我們?cè)诒镜馗北局袆?chuàng)建一個(gè) my_branch 分支。

root@json:~/svn/json01# ls
branches  tags  trunk
root@json:~/svn/json01# svn copy trunk/ branches/my_branch
A         branches/my_branch
root@json:~/svn/json01# 

查看狀態(tài):

root@json:~/svn/json01# svn status
A  +    branches/my_branch
A  +    branches/my_branch/HelloWorld.html
A  +    branches/my_branch/readme

提交新增的分支到版本庫(kù)。

root@json:~/svn/json01# svn commit -m "add my_branch" 
Adding         branches/my_branch
Replacing      branches/my_branch/HelloWorld.html
Adding         branches/my_branch/readme

Committed revision 9.

接著我們就到 my_branch 分支進(jìn)行開發(fā),切換到分支路徑并創(chuàng)建 index.html 文件。

root@json:~/svn/json01# cd branches/my_branch/
root@json:~/svn/json01/branches/my_branch# ls
HelloWorld.html  index.html  readme

將 index.html 加入版本控制,并提交到版本庫(kù)中。

root@json:~/svn/json01/branches/my_branch# svn status
?       index.html
root@json:~/svn/json01/branches/my_branch# svn add index.html 
A         index.html
root@json:~/svn/json01/branches/my_branch# svn commit -m "add index.html"
Adding         index.html
Transmitting file data .
Committed revision 10.

切換到 trunk,執(zhí)行 svn update,然后將 my_branch 分支合并到 trunk 中。

root@json:~/svn/json01/trunk# svn merge ../branches/my_branch/
--- Merging r10 into '.':
A    index.html
--- Recording mergeinfo for merge of r10 into '.':
 G   .

此時(shí)查看目錄,可以看到 trunk 中已經(jīng)多了 my_branch 分支創(chuàng)建的 index.html 文件。

root@json:~/svn/json01/trunk# ll
total 16
drwxr-xr-x 2 root root 4096 Nov  7 03:52 ./
drwxr-xr-x 6 root root 4096 Jul 21 19:19 ../
-rw-r--r-- 1 root root   36 Nov  7 02:23 HelloWorld.html
-rw-r--r-- 1 root root    0 Nov  7 03:52 index.html
-rw-r--r-- 1 root root   22 Nov  7 03:06 readme

將合并好的 trunk 提交到版本庫(kù)中。

root@json:~/svn/json01/trunk# svn commit -m "add index.html"
Adding         index.html
Transmitting file data .
Committed revision 11.