Presentation is loading. Please wait.

Presentation is loading. Please wait.

Subversion (SVN) Presented by 李明璋 R /2/21

Similar presentations


Presentation on theme: "Subversion (SVN) Presented by 李明璋 R /2/21"— Presentation transcript:

1 Subversion (SVN) Presented by 李明璋 R00944022 2012/2/21
由於這學期的程式作業都要用SVN來繳交,所以來介紹一下SVN是什麼?要怎麼使用? Presented by 李明璋 R 2012/2/21

2 繆昕 李明璋 506 508

3 When Programming… Have you ever encountered these problems?
第2筆測資終於可以跑了, 可是原本可以過的測資壞了!! 起床後忘了昨天改過哪些東西 /囧\ 砍掉重練後發現原本寫的方法才是對的QQ 終於把bug底掉了, 可是好像刪到不該刪的東西╰ (〒皿〒 ) ╯ 身為一個正常的資工系學生, 大概多少都碰過這些問題, 像是把code改一改, 就不小心改壞了 把某個Bug底掉後又出現新的Bug 全部砍掉重寫後發現原本寫的code才是對的 睡一覺後發現看不懂自己的code了 電腦燒壞了 等等等等等 阿阿~阿阿阿阿~ 硬碟冒煙了!!!! ………………………………………………………………………………………………………..

4 When Programming… BUT… while(1){
Thus, you always make a copy before you modify your files. } 這些慘痛的經驗告訴我們, code寫到一個段落或是要大幅度修改的時候 一定要備份. 但是 經過一次一次又一次的備份後, 資料夾裡的檔案就會一次一次又一次的增加 當你一段時間後想回來參考之前作業時, 就會發現, 完全不知道你當初在幹嘛 BUT…

5 And when team working, above problems will become much more complex and serious! 而且在與別人合作完成一份code的情況下, 上述問題會變得更加嚴重, 所以你也會更加頭大。

6 Any Solution? 當資工系遇到問題時我們就會開始想, 這個問題有解嗎?

7 SVN! 是的 今天要介紹的SVN 就能有效解決上面所有問題

8 What is Subversion (SVN)
SVN is an efficiently version control system. Renamed/copied/moved/removed files/folders retain full version history. Open source licensed. What is Subversion (SVN) SVN是什麼呢? 他是一個有效率的版本控制系統 會為你保存你每個版本修改的紀錄, 包括新增了哪些檔案, 刪除了哪些檔案, 哪些檔案在哪個版本被新增或移除 SVN是open source, 可以很容易取得, 而且容易使用

9 V.1 V.2

10 How to get your account? http://katrina.csie.ntu.edu.tw/1002dsa/
Account: 學號 Password: 自行設定 Enter your student ID number 我們已經架好了SVN server, 所以大家只要到這個網址去登入你的學號就可以開通帳號,

11 SVN Client TortoiseSVN SmartSVN EasySVN http://tortoisesvn.net/
EasySVN 有了SVN帳號後, 接著就要讓自己的電腦與我們的SVN server作連接, 這個時候就需要使用SVN client軟體 SVN client的軟體有很多, 比較常用的有這三種 今天會針對TortoiseSVN作介紹

12 SVN Client Download http://tortoisesvn.net/downloads.html
Download link

13 Install TortoiseSVN 打開下載的TortoiseSVN安裝程式 一路按Next, Next,…, and Install
安裝成功

14 How to use TortoiseSVN? Checkout - 將資料夾與SVN server連接
Commit - 上傳新版本(新增/刪除/修改) Update to the latest version Revert to the previous version

15 Checkout Your Files 在任意一個資料夾內或資料夾圖示上按右鍵, 點選SVN Checkout…

16 Checkout Your Files 在URL of repository輸入:
svn://katrina.csie.ntu.edu.tw/1002dsa/學號 接著按下OK

17 Checkout Your Files 輸入之前拿到的account, password 按下OK
Hint: 勾選Save authentication, 否則每做一個動作就會要求輸入一次帳號密碼

18 Checkout Your Files 完成~

19 Commit Edited Files 在SVN的資料夾(有checkout過的資料夾)內或資料夾圖示上按右鍵, 點選SVN Commit…

20 Commit Edited Files 在SVN的資料夾(有checkout過的資料夾)內或資料夾圖示上按右鍵, 點選SVN Commit…

21 Commit Edited Files 這一欄是輸入將要上傳版本的描述(強烈建議上傳時加上描述)
這一欄會顯示你變動過的檔案,勾選確定要更新的檔案, 按下OK

22 Commit Edited Files 完成!!

23 Update to the Latest Version
在SVN的資料夾(有checkout過的資料夾)內或資料夾圖示上按右鍵, 點選SVN Update

24 Update to the Latest Version
Finished~~

25 Update to Previous Versions
在SVN的資料夾(有checkout過的資料夾)內或資料夾圖示上按右鍵, 點選TortoiseSVN → Update to revision…

26 Update to Previous Versions
點選Show log 列出所有曾經上傳過的版本

27 Update to Previous Versions
從眾多歷史資料中挑選出你要回溯的版本, 按下OK確認 Hint: 在上傳時加入描述, 可以更有效率地找到想要的版本

28 Update to Previous Versions
完成^^

29 SVN Commands Checkout Add file/folder Commit file/folder
svn checkout svn://katrina.csie.ntu.edu.tw/1002dsa/r Type tour account & password Add file/folder svn add [file/folder name] Commit file/folder svn ci –m “message” [file/folder name](指定commit那些檔案) svn ci –m “message” (有修改/新增/刪除的都commit) Update to the latest version svn up Update to previous versions svn up –r[版本] Look up committed messages svn log More references about SVN commands and scripts:

30 SVN client for Mac and Linux
EasySVN SmartSVN


Download ppt "Subversion (SVN) Presented by 李明璋 R /2/21"

Similar presentations


Ads by Google