<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Knight of the round table

    wansong

    linux svn 常用命令

    apt-get install subversion
    apt-get install libapache2-svn

    http://blog.csdn.net/tianziczj/article/details/6180745
    http://www.cnblogs.com/PatrickChen/archive/2010/07/02/1769877.html
    http://www.wowcms.com/server/post_7930.html    主要參考這篇文章
     

     

    http://www.subversion.org.cn/svnbook/nightly/svn.ref.svn.c.diff.html

     


    客戶端Rabbitvcs 安裝:

    http://groups.google.com/group/rabbitvcs/browse_thread/thread/401666c0b327dd29
    http://yhjhoo.iteye.com/blog/839372

    參考rabbitvcs-0.14beta1根目錄下的 README AND clients/nautilus/README


     

    開發(fā)人員常用命令

     

    (1) 導(dǎo)入項(xiàng)目

    $ cd ~/project
    $ mkdir -p svntest/{trunk,branches,tags}
    $ svn import svntest https://localhost/test/svntest --message "Start project"
    ...
    $ rm -rf svntest

    我們新建一個(gè)項(xiàng)目svntest,在該項(xiàng)目下新建三個(gè)子目錄:trunk,開發(fā)主干;branches,開發(fā)分支;tags,開發(fā)階段性標(biāo)簽。然后導(dǎo)入到版本庫test下,然后把svntest拿掉。

    (2) 導(dǎo)出項(xiàng)目

    $ svn checkout https://localhost/test/svntest/trunk

    修訂版本號(hào)的指定方式是每個(gè)開發(fā)人員必須了解的,以下是幾個(gè)參考例子,說明可參考svn推薦書。

    $ svn diff --revision PREV:COMMITTED foo.c
    # shows the last change committed to foo.c

    $ svn log --revision HEAD
    # shows log message for the latest repository commit

    $ svn diff --revision HEAD
    # compares your working file (with local changes) to the latest version
    # in the repository

    $ svn diff --revision BASE:HEAD foo.c
    # compares your “pristine” foo.c (no local changes) with the
    # latest version in the repository

    $ svn log --revision BASE:HEAD
    # shows all commit logs since you last updated

    $ svn update --revision PREV foo.c
    # rewinds the last change on foo.c
    # (foo.c's working revision is decreased)

    $ svn checkout --revision 3
    # specified with revision number

    $ svn checkout --revision {2002-02-17}
    $ svn checkout --revision {15:30}
    $ svn checkout --revision {15:30:00.200000}
    $ svn checkout --revision {"2002-02-17 15:30"}
    $ svn checkout --revision {"2002-02-17 15:30 +0230"}
    $ svn checkout --revision {2002-02-17T15:30}
    $ svn checkout --revision {2002-02-17T15:30Z}
    $ svn checkout --revision {2002-02-17T15:30-04:00}
    $ svn checkout --revision {20020217T1530}
    $ svn checkout --revision {20020217T1530Z}
    $ svn checkout --revision {20020217T1530-0500}

    (3) 日常指令

    $ svn update

    $ svn add foo.file
    $ svn add foo1.dir
    $ svn add foo2.dir --non-recursive
    $ svn delete README
    $ svn copy foo bar
    $ svn move foo1 bar1

    $ svn status
    $ svn status --verbose
    $ svn status --verbose --show-updates
    $ svn status stuff/fox.c

    $ svn diff
    $ svn diff > patchfile

    $ svn revert README
    $ svn revert

    修改沖突發(fā)生時(shí),會(huì)生成三個(gè)文件:.mine, .rOLDREV, .rNEWREV。比如:

    $ ls -l
    sandwich.txt
    sandwich.txt.mine
    sandwich.txt.r1
    sandwich.txt.r2

    解決修改沖突方式之一:修改沖突的文件sandwich.txt,然后運(yùn)行命令:

    $ svn resolved sandwich.txt

    方式之二:用庫里的新版本覆蓋你的修改:

    $ cp sandwich.txt.r2 sandwich.txt
    $ svn resolved sandwich.txt

    方式之三:撤銷你的修改,這種方式不需要運(yùn)行resolved子命令:

    $ svn revert sandwich.txt
    Reverted 'sandwich.txt'
    $ ls sandwich.*
    sandwich.txt

    確保沒問題后,就可以提交了。

    $ svn commit --message "Correct some fatal problems"
    $ svn commit --file logmsg
    $ svn commit

    (4) 檢驗(yàn)版本歷史

    $ svn log
    $ svn log --revision 5:19
    $ svn log foo.c
    $ svn log -r 8 -v

    $ svn diff
    $ svn diff --revision 3 rules.txt
    $ svn diff --revision 2:3 rules.txt
    $ svn diff --revision 4:5 http://svn.red-bean.com/repos/example/trunk/text/rules.txt

    $ svn cat --revision 2 rules.txt
    $ svn cat --revision 2 rules.txt > rules.txt.v2

    $ svn list http://svn.collab.net/repos/svn
    $ svn list --verbose http://svn.collab.net/repos/svn

    $ svn checkout --revision 1729 # Checks out a new working copy at r1729

    $ svn update --revision 1729 # Updates an existing working copy to r1729

    (5) 其他有用的命令

    svn cleanup

    為失敗的事務(wù)清場。

    (6) 分支和合并

    建立分支方法一:先checkout然后做拷貝,最后提交拷貝。

    $ svn checkout http://svn.example.com/repos/calc bigwc
    A bigwc/trunk/
    A bigwc/trunk/Makefile
    A bigwc/trunk/integer.c
    A bigwc/trunk/button.c
    A bigwc/branches/
    Checked out revision 340.

    $ cd bigwc
    $ svn copy trunk branches/my-calc-branch
    $ svn status
    A + branches/my-calc-branch

    $ svn commit -m "Creating a private branch of /calc/trunk."
    Adding branches/my-calc-branch
    Committed revision 341.

    建立分支方法二:直接遠(yuǎn)程拷貝。

    $ svn copy http://svn.example.com/repos/calc/trunk \
    http://svn.example.com/repos/calc/branches/my-calc-branch \
    -m "Creating a private branch of /calc/trunk."

    Committed revision 341.

    建立分支后,你可以把分支checkout并繼續(xù)你的開發(fā)。

    $ svn checkout http://svn.example.com/repos/calc/branches/my-calc-branch

    假設(shè)你已經(jīng)checkout了主干,現(xiàn)在想切換到某個(gè)分支開發(fā),可做如下的操作:

    $ cd calc
    $ svn info | grep URL
    URL: http://svn.example.com/repos/calc/trunk
    $ svn switch http://svn.example.com/repos/calc/branches/my-calc-branch
    U integer.c
    U button.c
    U Makefile
    Updated to revision 341.
    $ svn info | grep URL
    URL: http://svn.example.com/repos/calc/branches/my-calc-branch

    合并文件的命令參考:

    $ svn diff -r 343:344 http://svn.example.com/repos/calc/trunk
    $ svn merge -r 343:344 http://svn.example.com/repos/calc/trunk
    $ svn commit -m "integer.c: ported r344 (spelling fixes) from trunk."
    $ svn merge -r 343:344 http://svn.example.com/repos/calc/trunk my-calc-branch
    $ svn merge http://svn.example.com/repos/branch1@150 \
    http://svn.example.com/repos/branch2@212 \
    my-working-copy
    $ svn merge -r 100:200 http://svn.example.com/repos/trunk my-working-copy
    $ svn merge -r 100:200 http://svn.example.com/repos/trunk
    $ svn merge --dry-run -r 343:344 http://svn.example.com/repos/calc/trunk

    最后一條命令僅僅做合并測試,并不執(zhí)行合并操作。

    建立標(biāo)簽和建立分支沒什么區(qū)別,不過是拷貝到不同的目錄而已。

    $ svn copy http://svn.example.com/repos/calc/trunk \
    http://svn.example.com/repos/calc/tags/release-1.0 \
    -m "Tagging the 1.0 release of the 'calc' project."

    $ ls
    my-working-copy/
    $ svn copy my-working-copy http://svn.example.com/repos/calc/tags/mytag
    Committed revision 352.

    后一種方式直接把本地的工作拷貝復(fù)制為標(biāo)簽。

    此外,你還可以刪除某個(gè)分支。

    $ svn delete http://svn.example.com/repos/calc/branches/my-calc-branch \
    -m "Removing obsolete branch of calc project."

    管理人員常用命令

    (7) 版本庫管理

    $ svnadmin help
    ...
    $ svnadmin help create
    ...
    $ svnadmin create --fs-type bdb /usr/local/repository/svn/test
    $ chown -R svn.svn /usr/local/repository/svn/test

    建立版本庫,庫類型為bdb(使用Berkeley DB做倉庫),庫名稱為test。
    svn版本庫有兩種存儲(chǔ)方式:基于Berkeley DB(bdb)或者基于文件系統(tǒng)(fsfs),通過 --fs-type可指定存儲(chǔ)方式。

    (8) 查詢版本庫信息

    $ svnlook help
    ...
    $ svnlook help tree
    ...
    $ svnlook tree /usr/local/repository/svn/test --show-ids

    posted on 2012-01-15 20:23 w@ns0ng 閱讀(1678) 評論(0)  編輯  收藏 所屬分類: Linux

    主站蜘蛛池模板: 免费无遮挡无码视频在线观看| 亚洲永久中文字幕在线| 亚洲国产精品嫩草影院| 国产h肉在线视频免费观看| 久久久久亚洲av无码专区蜜芽| 黄桃AV无码免费一区二区三区| 免费一看一级毛片人| 国产成人精品久久亚洲高清不卡| 国产在线98福利播放视频免费| 久久亚洲精品成人无码| 日本高清色本免费现在观看| 亚洲av无码专区首页| 国产精品视频免费一区二区三区 | 国产午夜鲁丝片AV无码免费| 亚洲精品无码久久久久秋霞 | 人人爽人人爽人人片A免费| 国产免费拔擦拔擦8x| 特级毛片aaaa免费观看| 国产亚洲色婷婷久久99精品91| 插鸡网站在线播放免费观看| 亚洲AV永久无码精品成人| 99re在线这里只有精品免费| 亚洲国产综合精品| 免费看美女让人桶尿口| 免费在线人人电影网| 亚洲中文字幕无码一区二区三区 | 亚洲伦理一区二区| 人禽杂交18禁网站免费| 视频一区二区三区免费观看| 亚洲中久无码永久在线观看同| 久久久久久AV无码免费网站| 亚洲二区在线视频| 亚洲精品无码AV中文字幕电影网站| 免费人成动漫在线播放r18| 亚洲精品亚洲人成人网| 嘿嘿嘿视频免费网站在线观看| 亚洲AV色无码乱码在线观看| 久久精品国产亚洲一区二区三区| 十九岁在线观看免费完整版电影| 亚洲啪AV永久无码精品放毛片| 亚洲一区二区视频在线观看|