`

svn在windows下的安装步骤

阅读更多
svn在windows系统下的安装步骤
1)首先去官方网站下载安装包
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
笔者下载的是svn-win32-1.5.4.zip解压文件
1). Download SVN server file and unzip to anywhere you prefer.
The file i used is the latest version: svn-win32-1.5.6.zip
2)设置把解压文件的bin子目录添加到patp的环境变量中
2). Add its bin directry into PATH environment veriable
Once finished, type ’svn’ command in DOS or terminal to test the installation and settings.
3)创建一个存放工程(会有很多工程)的目录 比如E:/svnworkspace
然后再创建一个工程(例如工程名称为myfirstproject)
C:\>svnadmin create E:/svnworkspace/myfirstproject
3). Now, let’s create a new project
svnadmin create D:\repository\myproject
4)配置项目
设置一些配置访问权限 访问认证信息
创建的新工程E:/svnworkspace/myfirstproject下面有个conf目录,下面有三个文件authz,passwd,svnserve.conf
打开svnserve.conf设置项主要有
[general]
anon-access = read//匿名用户只有读权限
auth-access = write//认证用户有写权限
password-db = passwd//用户密码设置文件名称
authz-db = authz//用户权限设置文件名称
realm = myfirstproject//项目名称
打开passwd设置项主要有
littlelion = 123456
打开authz设置项主要有
[groups]
developers = littlelion
@developers = rw
4). Configure our new project

After myproject was created successfully, you will find several files and folders created in it.

In conf folder, there are three files - authz, passwd, svnserve.conf - listing.

– svnserve.conf: the main entry for your project configuration.

In general section, set:

anon-access = none ## anonymous users are not allowed to access

auth-access = write ## authenticated users have write privilege.

password-db = passwd ## use the default password file, i.e. passwd file

authz-db = authz ## use the default authorization file, i.e. authz file

realm = myproject ## which realm to be protected. Here is our new project, i.e. myproject

–passwd: the user accounts are stored here

We will add two users for demonstration, harry and sally. You can just uncomment the existing lines.

harry = harryssecret ## harry is the user login name, harryssecret is his password.
sally = sallyssecret

–authz: authorization for the users

We make harry become a developer, sally is an observer only.

[groups]
developers = harry

Then we grant the permissions for them.

[myproject:/]
@developers = rw
sally= r
5)启动svn服务
C:\>svnserve -d -r E:/svnworkspace2 --listen-port 9000
注意listen-port前面是两个分隔符,不然命令无效
5). Now, the configuration was finished, so lets start the svn server
svnserve -d -r D:\repository --listen-port 9000
6)导入工程项目
C:\>svn import F:\workspace2\myfirstproject svn://localhost:9000/myfirstproject -m "initial import" --username littlelion --password 123456
还是注意用户名密码前的两个分隔符写法
import第一个是需要导入的工程项目  第二个是导入到svn库的位置,需要先建立一个svn项目才能导入这个项目,否则不能导入
导入后可以导出这个项目
C:\>svn co svn://localhost:9000/myfirstproject C:/myfirstproject --username littlelion --password 123456
6). Check out our new project
svn co svn://ip|host:9000/myproject  myproject  --username harry --password harryssecret
You can also make svn server as a windows service:
sc create svn binpath= "[yoursvnfolder]\bin\svnserve.exe --service -r D:\repository --listen-port 9000" displayname= "Subvsersion Server Service" depend= Tcpip start= auto
If you want to reconfigure:
sc config svn binpath= "[yoursvnfolder]\bin\svnserve.exe --service -r D:\repository --listen-port 9000" displayname= "Subvsersion Server Service" depend= Tcpip start= auto
Note: There is a space after each ‘=’ symbol.
P.S. svn server can be integrated with http server wonderfully, so that all svn files can be accessed via http protocol. But this is out of the scope of my article, because I already said I just want a simple svn server.
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics