SVN 的基本指令介紹, 主要參考自下述:
- SubTrain - Open Source Trainings for Subversion: 教導如何使用 SVN
- Version Control with Subversion(中文版電子書)
- Version Control with Subversion PDF - 作者: 邱茂森(Google 找到的, 相當實用的介紹 和 說明)
主要 SubTrain 的 PPT 前面頁數看一看, 基礎就大概都知道了, 後面頁數太進階了, 目前用不到, 以後再看. XD
PS: 如果不知道 SVN 是什麼, 可見此文: 淺談版本控制系統, 裡面連結檔案看完, 應該就很清楚了 :)
先來看 SVN Trunk/Tags/Branches 目錄 的 架構 和 用途:(英文說明轉載自 SubTrain PPT)
- trunk: Main line of development(主幹, 主要開發都由在 trunk)
- tags: Releases (想要 Release 的時後, 就標個 Tag, 以後可以依 Tag 來找回之前版本的資料)
- branches: Preparation of release, bug fixing(分支, 可以將某些功能切出來, 或者 bug fix 等切成分支, 等做完後再用 Merge 合併回來)
SVN 基本功能:
Import: 將整個 project_directory 的資料 import 進 svn 裡面
- svn import project_directory http://DOMAIN/svn_project
- svn import project_directory file:///SVN_PATH/svn_project
Checkout: (checkout 可簡寫成 co), 將資料 checkout 回來
- svn co http://SVN_PATH/svn_project
- svn co file:///SVN_PATH/svn_project
- svn co -r 12 file:///var/lib/svn/dev/projects # 出第12版的 projcets code
List: (list 可簡寫成 ls), 看上面有哪些檔案/資料
- svn ls http://SVN_PATH/svn_project
- svn ls file:///SVN_PATH/svn_project
Update: (update 可簡寫成 up), 將目前資訊更新成 SVN 線上最新版本.
- SVN_CHECKOUT_DIR$ svn up
- SVN_CHECKOUT_DIR$ svn ci
- SVN_CHECKOUT_DIR$ svn st
- SVN_CHECKOUT_DIR$ svn add filename 或 svn add directory
- SVN_CHECKOUT_DIR$ svn mv filename new_filename
- SVN_CHECKOUT_DIR$ svn revert [file | directory]
SVN 檔案狀態資訊:
- ?: 此檔案不存在 SVN 裡面
- A: 此次新增的檔案
- C: 此檔案已經有人改過, 合併不成功, 需要人工介入
- D: 此次移除的檔案
- M: 此檔案有修改過
- U: 此檔案有被更新過
再來是比較進階一點點, 下述範例轉載自 SubTrain 的教學 PPT:
建立一個 branch
- svn copy http://svnserver/calc/trunk http://svnserver/calc/branches/my-calc-branch -m 'create a branch'
建立 Release Tags:
- svn copy http://svnserver/calc/trunk http://svnserver/calc/tags/Release-1.0.0 -m 'create Release tags for Release 1.0.0'
合併兩個版本的檔案 # 參考自: 用 Subversion 的 Merge 來 Undo
- svn merge -r REV1:REV2 {path/to/workingcopy}
- (UNDO) svn merge -r 1234:1233 . .
- (MERGE)svn merge -r 1233:1234 . .
- svn merge --dry-run -r 343:344 http://svn.example.com/repos/calc/trunk
- svn resolved filename # 這樣子下就會把自動產生 diff 等的檔案刪除
找版本間有什麼不同 diff:
- svn diff # 自動以現在檔案跟 SVN 內最新版做 diff
- svn diff -r9237:9238
- svn info
Log: 如果沒輸入參數, 預設會把所有 commit log 都列出來
- svn log
Propset (propset, pset, ps): 版本控制都有些特殊 Keyword 設定, 如 Id 就是最常用的, 設定方法如下:
- 在檔案內找地方加入 $Id$
- 設定此檔案要能吃 Id 的 Keyword: svn ps svn:keywords 'Id' filename (只需設一次即可, 之後就不用再設)
- svn ci 後, $Id$ 會自動代換成
$Id:filename 編號 年月日時分秒 username $
的資訊 - svn help ps 可以看到有哪些 Keyword 可以用, 即 Keyword 的說明.(ex: URL, Author, Date, Rev, Id 等.)
其它 SVN Client:
- Windows Client: TortoiseSVN
- SVK: The SVK version control system
其它相關網頁
18 comments:
It even contributes pollution to the environment aand most of all,
it can damage the lungs of the human body. The hazard of traditional tobacco cigarettes has been preached to no end over time.
There is no lingering odor on the interior of the car because there is no smoke.
Feel free to surf to my website sigaretta elettronica shop
I visited various web sites except the audio feature for audio songs
current at this site is actually fabulous.
Also visit my blog: brooklyn condominium inspection (youtube.com)
Excellent blog right here! Also your website a lot up very fast!
What host are you the use of? Can I am getting your affiliate link on your host?
I want my web site loaded up as fast as yours lol
Here is my site: http://Top.Tessasarcade.Info/
Generally, the system needs to be pumped out for every 1 to 3 years.
Then off course, to keep your septic system in proper
running order it's always advisable to get
a Septic Tank Pumping done every three to five years. Typically,
50-80% of household wastewater is greywater, the rest are from the toilets or contaminated greywater.
Feel free to surf to my blog ... http://76.108.202.25/
Heya i am for the first time here. I came across this board and I find It really useful & it helped me out much.
I hope to give something back and help others like you aided me.
Take a look at my weblog ... costa rica snook fishing videos
Attractive section of content. I just stumbled upon your weblog
and in accession capital to assert that I acquire actually enjoyed account your
blog posts. Any way I will be subscribing to your augment and even I achievement you
access consistently fast.
My page: download witcher 3 online
Hmm it looks like your blog ate my first comment (it was extremely
long) so I guess I'll just sum it up what I had written and say,
I'm thoroughly enjoying your blog. I as well am an aspiring blog
writer but I'm still new to everything. Do you have any recommendations for
novice blog writers? I'd definitely appreciate it.
my blog: aspergers in love
Actually, one of the main reasons why this is considered as relevant
is because there are a multitude of people that come to pass, stay
or linger within subways. You'll come under fire from
a number of ranged attackers, and at least two that will lob
fire at you. When you pick the opposite you have Southwest Airlines.
my site ... Subway Surf Hack
When I originally commented I appear to have clicked on the -Notify
me when new comments are added- checkbox and from now on whenever a comment is added I
get four emails with the same comment. Perhaps there is a means you can remove me
from that service? Kudos! www.cats.hintcenter.com
Look into my web page ... cat health problems
Wow, that's what I was looking for, what a data!
existing here at this weblog, thanks admin of this site.
Here is my web-site :: war of mercenaries cheat ()
I just could not go away your website before
suggesting that I extremely enjoyed the usual info a person supply in your guests?
Is going to be back continuously to investigate cross-check new posts
Feel free to visit my site ... http://bestwoocommercethemes.blogspot.com/2014/05/great-advice-about-wordpress-that.html
Hi! I just wanted to ask if you ever have any problems with hackers?
My last blog (wordpress) was hacked and I ended up losing months
of hard work due to no data backup. Do you have any methods to prevent hackers?
Check out my webpage; diy home improvement ideas, http://www.homeimprovementdaily.com/,
After exploring a handful of the blog articles on your web page, I
really appreciate your way of writing a blog.
I book marked it to my bookmark website list and will be checking back soon.
Please visit my web site as well and tell me what you think.
Also visit my webpage; http://coquetaclub.blogspot.com/2010/08/girls-nite-out-one-more-time.html
If you want to get a great deal from this post then you have to
apply such techniques to your won blog.
My web page :: חיים מנעולים באזור ירושלים
Post a Comment