ubuntu搭建svn服务器以及管理项目

本文详细介绍如何在Ubuntu系统上安装并配置Subversion (SVN) 服务器,包括安装SVN、开启服务、创建仓库、修改配置文件、设置用户名密码等步骤,并提供了上传代码和更换SVN地址的方法。

在Ubuntu下安装配置svn服务器

 

1. 安装svn

 

sudo apt-get install subversion

 

2. 开启svn服务器

 

svnserve -d

 

检查是否开启:ps aux | grep svnserve

 

若出现如下内容:

 

wkr 6537 0.0 0.0 13784 956 ? Ss 16:18 0:00 svnserve -d
wkr 7593 0.0 0.0 5784 864 pts/0 S+ 21:57 0:00 grep –color=auto svnserve

 

表示服务已开启。(注意:一定要有第1行,只有第2行说明服务未启动)

启动单个代码仓库:

svnserve -d -r /home/svn --listen-host 192.168.213.31

 

3. 建立仓库

 

svnadmin create /home/svn
理论上,仓库可以建立在任何目录中。

 

4. 修改配置文件

 

编辑 svnserve.conf

 

gedit /home/svn/conf/svnserve.conf

#去掉#[general]前面的#号 

[general] 

#匿名访问的权限,可以是read,write,none,默认为read 

anon-access = none

#认证用户的权限,可以是read,write,none,默认为write 

auth-access = write

#密码数据库的路径,去掉前面的# 

password-db = passwd

注:当你去掉注释的时候,不要简单的把前面的#去掉,要把前面的空格一块去掉,不然在Eclipse中使用的时候会出现配置文件格式错误的问题。

 

5. 设置用户名密码

 

gedit /home/svn/conf/passwd

 

### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.

 

[users]
# harry = harryssecret
# sally = sallyssecret
user1 = pass1  # 输入你定义的用户名和密码,密码显然没有加密

6.上传代码

svn import -m "import" /home/project(项目路径) svn://192.168.213.31/svn

 

7.更换svn地址

svn switch --relocate [url]http://xxx.xxx.xxx.xxx/xxx[/url](旧的svn地址) [url]http://xxx.xxx.xxx.xxx/xxx[/url](新的svn地址)

 

配置eclipse svn客户端

eclipse菜单栏help->Install New Software

http://subclipse.tigris.org/update_1.8.x

在eclipse里新建project,在new project里选择svn里的checkout project from svn

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值