1、 到網(wǎng)站http://subversion.tigris.org/下載Subversion安裝。
2、測(cè)試是否安裝成功
???? 已Windows平臺(tái)為例,運(yùn)行cmd。
???? 輸入path查看subversion\bin是否已經(jīng)在其中。
???? 運(yùn)行svn help,正常應(yīng)該有如下輸出:
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來(lái)創(chuàng)建一個(gè)倉(cāng)庫(kù)
???? svnadmin create d:\testrep
???? 檢查一下是否創(chuàng)建成功,dir d:\testrep
???? [.] [..] [conf] [dav] [db] format
???? [hooks] [locks] README.txt
4、這樣倉(cāng)庫(kù)就建好了,接下來(lái)就是開(kāi)始使用了
5、轉(zhuǎn)到你的工程目錄,這里用test為例了
在test目錄下面只有一個(gè)文件叫test.txt
6、執(zhí)行導(dǎo)入 svn import test file:///d:/testrep/test -m 'just for test' ,成功執(zhí)行輸出如下:
???? Adding test\test.txt
???? Committed revision 1.
7、檢查是否已經(jīng)成功導(dǎo)入:svn list file:///d:/testrep
test
8、現(xiàn)在可以檢出test了: svn checkout file:///d:/testrep/test
9、檢查狀態(tài)svn status test,會(huì)發(fā)現(xiàn)沒(méi)有任何改變
10、修改test.txt文件,在檢查狀態(tài),你會(huì)發(fā)現(xiàn)有如下輸出 "M test\test.txt"
11、顯示區(qū)別: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、好了,基本的應(yīng)用就是這樣了,至于其他的你可以看到svn help里面還有很多命令
?
附:
在提交中文文件的時(shí)候可能會(huì)出現(xiàn)錯(cuò)誤,這時(shí)候你需要添加一個(gè)環(huán)境變量:
APR_ICONV_PATH=D:\Subversion\iconv (這個(gè)目錄在subversion的安裝目錄下面)
?
假如還有什么不明白的,可以郵件聯(lián)系我