1、 到網站http://subversion.tigris.org/下載Subversion安裝。
2、測試是否安裝成功
???? 已Windows平臺為例,運行cmd。
???? 輸入path查看subversion\bin是否已經在其中。
???? 運行svn help,正常應該有如下輸出:
D:\>svn help usage: svn[options] [args] Subversion command-line client, version 1.3.1. Type 'svn help ' for help on a specific subcomman Most subcommands take file and/or directory arguments, recurs on the directories. If no arguments are supplied to such a command, it recurses on the current directory (inclusive) by Available subcommands: add blame (praise, annotate, ann) cat checkout (co) cleanup commit (ci) copy (cp) delete (del, remove, rm) diff (di) export help (?, h) import info list (ls) lock log merge mkdir move (mv, rename, ren) propdel (pdel, pd) propedit (pedit, pe) propget (pget, pg) proplist (plist, pl) propset (pset, ps) resolved revert status (stat, st) switch (sw) unlock update (up) Subversion is a tool for version control. For additional information, see http://subversion.tigris.org/
3、用svnadmin來創建一個倉庫
???? svnadmin create d:\testrep
???? 檢查一下是否創建成功,dir d:\testrep
???? [.] [..] [conf] [dav] [db] format
???? [hooks] [locks] README.txt
4、這樣倉庫就建好了,接下來就是開始使用了
5、轉到你的工程目錄,這里用test為例了
在test目錄下面只有一個文件叫test.txt
6、執行導入 svn import test file:///d:/testrep/test -m 'just for test' ,成功執行輸出如下:
???? Adding test\test.txt
???? Committed revision 1.
7、檢查是否已經成功導入:svn list file:///d:/testrep
test
8、現在可以檢出test了: svn checkout file:///d:/testrep/test
9、檢查狀態svn status test,會發現沒有任何改變
10、修改test.txt文件,在檢查狀態,你會發現有如下輸出 "M test\test.txt"
11、顯示區別:svn diff test\test.txt
Index: test/test.txt =================================================================== --- test/test.txt (revision 3) +++ test/test.txt (working copy) @@ -1 +1,2 @@ -Hello World \ No newline at end of file +Hello World +add line \ No newline at end of file
12、提交修改
D:\>svn ci test\test.txt -m "add a line"
Sending test\test.txt
Transmitting file data .
Committed revision 4.
13、好了,基本的應用就是這樣了,至于其他的你可以看到svn help里面還有很多命令
?
附:
在提交中文文件的時候可能會出現錯誤,這時候你需要添加一個環境變量:
APR_ICONV_PATH=D:\Subversion\iconv (這個目錄在subversion的安裝目錄下面)
?
假如還有什么不明白的,可以郵件聯系我