当前位置:网站首页>如何在本机搭建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
- 潘多拉 IOT 开发板学习(HAL 库)—— 实验5 外部中断实验(学习笔记)
- Go language self-study series | if else if statement in golang
- Microservice - Nacos registration center and configuration center
- Problems of CString in multithreading
- Win32 create window and button (lightweight)
- Secsha system 1- login function
- [redis foundation] understand redis persistence mechanism together (rdb+aof graphic explanation)
- [proteus simulation] 74hc595+74ls154 drive display 16x16 dot matrix
猜你喜欢
Reading notes of "micro service design" (Part 2)
Find mapping relationship
面试官:JVM如何分配和回收堆外内存
Please be prepared to lose your job at any time within 3 years?
From "zero sum game" to "positive sum game", PAAS triggered the third wave of cloud computing
How to use AAB to APK and APK to AAB of Google play apps on the shelves
Brush questions -- sword finger offer
Microservices Seata distributed transactions
Secsha system 1- login function
uploads-labs靶场(附源码分析)(更新中)
随机推荐
Pyinstaller is not an internal or external command, nor is it a runnable program or batch file
Jmeter线程组功能介绍
Using optimistic lock and pessimistic lock in MySQL to realize distributed lock
Getting started with Message Oriented Middleware
《天天数学》连载56:二月二十五日
Go语言自学系列 | golang switch语句
Mixlab编辑团队招募队友啦~~
[proteus simulation] 8 × 8LED dot matrix screen imitates elevator digital scrolling display
[list to map] collectors Tomap syntax sharing (case practice)
[web security] - [SQL injection] - error detection injection
June to - -------
Salary 3000, monthly income 40000 by "video editing": people who can make money never rely on hard work!
Pychart error updating package list: connect timed out
Colab works with Google cloud disk
[combinatorics] combinatorial identity (sum of variable upper terms 1 combinatorial identity | summary of three combinatorial identity proof methods | proof of sum of variable upper terms 1 combinator
App移动端测试【4】apk的操纵
用同花顺炒股开户安全吗?
请做好3年内随时失业的准备?
嵌入式开发:避免开源软件的7个理由
关于网页中的文本选择以及统计选中文本长度