当前位置:网站首页>如何在本机搭建SVN服务器
如何在本机搭建SVN服务器
2022-07-03 16:07:00 【星哥玩云】
目的:在没有正式的SVN服务器的情况下,完成代码的本地备份。
下载:
http://subversion.tigris.org/
http://subversion.apache.org/
http://www.visualsvn.com/server/download/
Apache下载:httpd.apache.org/download.cgi
SVN下载:subversion.tigris.org/servlets/ProjectDocumentList
Tortoise下载:prdownloads.sourceforge.net/tortoisesvn/TortoiseSVN-1.3.2.5840-svn-1.3.0.msi
Tortoise中文简体语言包下载:在prdownloads.sourceforge.net/tortoisesvn/LanguagePack_1.3.2_zh_CN.exe
Windows下SVN服务器搭建与使用图文教程 http://www.linuxidc.com/Linux/2013-03/81665.htm
参考:
1,软件下载
下载Subversion服务器程序。
到官方网站的下载二进制安装文件,来到二进制包下载部分,找到 Windows NT, 2000, XP and 2003部分,然后选择" this directory ",这样我们可以看到许多下载的内容,目前可以下载 svn-1.4.0-setup.exe 。
下载Subversion的Windows客户端TortoiseSVN。
TortoiseSVN是扩展Windows Shell的一套工具,可以看作Windows资源管理器的插件,安装之后Windows就可以识别Subversion的工作目录。 官方网站是TortoiseSVN ,下载方式和前面的svn服务器类似,在Download页面的我们可以选择下载的版本,目前的最高稳定版本的安装文件为TortoiseSVN-1.4.0.7501-win32-svn-1.4.0.msi。
2,服务器和客户端安装
服务器安装,直接运行svn-1.4.0-setup.exe ,根据提示安装即可,这样我们就有了一套服务器可以运行的环境。
安装TortoiseSVN,同样直接运行TortoiseSVN-1.4.0.7501-win32-svn-1.4.0.msi按照提示安装即可,不过最后完成后会提示是否重启,其实重启只是使svn工作拷贝在windows中的特殊样式生效,与所有的实际功能无关,这里为了立刻看到好的效果,还是重新启动机器。
3,建立版本库(Repository)
运行Subversion服务器需要首先要建立一个版本库(Repository),可以看作服务器上存放数据的数据库,在安装了Subversion服务器之后,可以直接运行,如:
svnadmin create E:/svndemo/repository就会在目录E:/svndemo/repository下创建一个版本库。
我们也可以使用TortoiseSVN图形化的完成这一步: 在目录E:/svndemo/repository下"右键->TortoiseSVN->Create Repository here...“, 然后可以选择版本库模式, 这里使用默认即可, 然后就创建了一系列目录和文件。
4,配置用户和权限
来到E:/svndemo/repository/conf目录,修改svnserve.conf: # [general] # password-db = passwd 改为: [general] password-db = passwd 然后修改同目录的passwd文件,去掉下面三行的注释: # [users] # harry = harryssecret # sally = sallyssecret 最后变成: [users] harry = harryssecret sally = sallyssecret
在这里,因为一般来说,项目的svn的用户名和密码是统一认证的,而为了不每次都输入密码,所以在使用TortoiseSVN的时候,直接都记住了密码,这里的用户名和密码最好和项目的一致,以免出现意外情况。
5,运行独立服务器
在任意目录下运行: svnserve -d -r E:/svndemo/repository 我们的服务器程序就已经启动了。注意不要关闭命令行窗口,关闭窗口也会把svnserve停止。
在使用中发现,即使关闭了此窗口,svn一样好使~~不知道为啥~
6,初始化导入
来到我们想要导入的项目根目录,在这个例子里是E:/svndemo/initproject,目录下有一个readme.txt文件:
右键->TortoiseSVN->Import... URL of repository输入“svn://localhost/” ok 完成之后目录没有任何变化,如果没有报错,数据就已经全部导入到了我们刚才定义的版本库中。
需要注意的是,这一步操作可以完全在另一台安装了TortoiseSVN的主机上进行。例如运行svnserve的主机的IP是133.96.121.22,则URL部分输入的内容就是“svn://133.96.121.22/”。
在这里,不知道为什么,使用svn://localhost/ 一直都搞不定,最后灵机一动使用了file:///E:/svndemo/repository/ 反而搞定了~~
7,基本客户端操作
取出版本库到一个工作拷贝: 来到任意空目录下,在本例中是E:/svndemo/wc1,运行右键->Checkout,在URL of repository中输入svn://localhost/,这样我们就得到了一份工作拷贝。 在工作拷贝中作出修改并提交: 打开readme.txt,作出修改,然后右键->Commit...,这样我们就把修改提交到了版本库,我们可以运行。
察看所作的修改: readme.txt上右键->TortoiseSVN->Show Log,这样我们就可以看到我们对这个文件所有的提交。在版本1上右键->Compare with working copy,我们可以比较工作拷贝的文件和版本1的区别。
边栏推荐
- Why can't strings be directly compared with equals; Why can't some integers be directly compared with the equal sign
- Reflection on some things
- 请求头不同国家和语言的表示
- [web security] - [SQL injection] - error detection injection
- Please be prepared to lose your job at any time within 3 years?
- How can technology managers quickly improve leadership?
- TCP拥塞控制详解 | 3. 设计空间
- 分布式事务(Seata) 四大模式详解
- Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (4)
- Brush questions -- sword finger offer
猜你喜欢

0214-27100 a day with little fluctuation

MongoDB 的安装和基本操作

请做好3年内随时失业的准备?

Redis在Windows以及Linux系统下的安装

Introduction series of software reverse cracking (1) - common configurations and function windows of xdbg32/64

Asemi rectifier bridge umb10f parameters, umb10f specifications, umb10f package
![SDNU_ ACM_ ICPC_ 2022_ Winter_ Practice_ 4th [individual]](/img/3b/7523eca5bbcdbba29d9b7f6e4791a5.jpg)
SDNU_ ACM_ ICPC_ 2022_ Winter_ Practice_ 4th [individual]

App移动端测试【5】文件的写入、读取

The mixlab editing team is recruiting teammates~~

Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (I)
随机推荐
EditText request focus - EditText request focus
Under VC, Unicode and ANSI are converted to each other, cstringw and std:: string are converted to each other
Microservice - Nacos registration center and configuration center
Microservices Seata distributed transactions
《天天数学》连载56:二月二十五日
Record a jar package conflict resolution process
Intelij idea efficient skills (III)
0214-27100 a day with little fluctuation
首发!!lancet饿了么官方文档
Semi supervised learning
[proteus simulation] 74hc595+74ls154 drive display 16x16 dot matrix
Three dimensional reconstruction of deep learning
突破100万,剑指200万!
Hibernate的缓存机制/会话级缓存机制
Is it safe to open an account with tongdaxin?
Nifi from introduction to practice (nanny level tutorial) - flow
Batch files: list all files in a directory with relative paths - batch files: list all files in a directory with relative paths
潘多拉 IOT 开发板学习(HAL 库)—— 实验5 外部中断实验(学习笔记)
无心剑中译泰戈尔《漂鸟集(1~10)》
App移动端测试【4】apk的操纵