当前位置:网站首页>如何在本机搭建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的区别。
边栏推荐
- The accept attribute of the El upload upload component restricts the file type (detailed explanation of the case)
- Pandora IOT development board learning (HAL Library) - Experiment 5 external interrupt experiment (learning notes)
- Rk3399 platform development series explanation (WiFi) 5.54. What is WiFi wireless LAN
- Client does not support authentication protocol requested by server; consider upgrading MySQL client
- 嵌入式开发:避免开源软件的7个理由
- uploads-labs靶场(附源码分析)(更新中)
- MB10M-ASEMI整流桥MB10M
- Under VC, Unicode and ANSI are converted to each other, cstringw and std:: string are converted to each other
- 半监督学习
- 首发!!lancet饿了么官方文档
猜你喜欢
Automatic generation of client code from flask server code -- Introduction to flask native stubs Library
Myopia: take off or match glasses? These problems must be understood clearly first
[proteus simulation] 8 × 8LED dot matrix screen imitates elevator digital scrolling display
请做好3年内随时失业的准备?
Brush questions -- sword finger offer
SDNU_ ACM_ ICPC_ 2022_ Winter_ Practice_ 4th [individual]
Intelij idea efficient skills (III)
面试官:JVM如何分配和回收堆外内存
The difference between calling by value and simulating calling by reference
Embedded development: seven reasons to avoid open source software
随机推荐
Why can't strings be directly compared with equals; Why can't some integers be directly compared with the equal sign
【OpenCV 例程200篇】217. 鼠标交互获取多边形区域(ROI)
Please be prepared to lose your job at any time within 3 years?
Location of software installation information and system services in the registry
面试官:JVM如何分配和回收堆外内存
Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (I)
How idea starts run dashboard
Redis high availability and persistence
"Everyday Mathematics" serial 56: February 25
The difference between calling by value and simulating calling by reference
Getting started with Message Oriented Middleware
App移动端测试【5】文件的写入、读取
"Remake Apple product UI with Android" (2) -- silky Appstore card transition animation
半监督学习
几种常见IO模型的原理
Batch files: list all files in a directory with relative paths - batch files: list all files in a directory with relative paths
高等数学(第七版)同济大学 习题2-1 个人解答
无心剑中译泰戈尔《漂鸟集(1~10)》
App移动端测试【3】ADB命令
WinDbg analysis dump file