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的安装目录下面)
假如还有什么不明白的,可以邮件联系我