一、TortoiseSVN基本设置
1.1 客户端设置
![](http://upload-images.jianshu.io/upload_images/13092138-b3e86e6cbfc7307d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/420/format/webp)
1.1 语言设置
![](http://upload-images.jianshu.io/upload_images/13092138-da29ab18565bce1b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/699/format/webp)
二、基本操作
2.1 浏览服务器
![](http://upload-images.jianshu.io/upload_images/13092138-70a93e56780eed93.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/357/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-b546cf3b122b2589.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/401/format/webp)
用户名跟密码,跟公司配置管理员人员获取,没有专门的管理员,找管理svn管理人员分配
![](http://upload-images.jianshu.io/upload_images/13092138-5836368c38fa1aca.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/636/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-1b6e091c3ca0bf9f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/643/format/webp)
2.2 查看日志
![](http://upload-images.jianshu.io/upload_images/13092138-87332796c836528a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/985/format/webp)
2.3导入目录Import
我们可以使用“导入”将外部目录导入到SVN仓库。首先,在要导入的目录上点击右键,依次选择菜单“TortoiseSVN->导入”,然后输入注释,点击“确认”完成导入。
![](http://upload-images.jianshu.io/upload_images/13092138-20de2b0aece1eeb5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/384/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-50017c5315c4a6f3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/464/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-e70aba8b256ec63f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/668/format/webp)
2.4 检出数据Checkout
使用SVN库工作之前,需要先从SVN服务器上将目录检出到本地,我们称之为“工作副本”。首先,在本机创建一个目录,将这个目录作为工作副本的根目录;然后,进入这个目录,点击右键菜单“SVN检出...”;选择要导出的URL后,最后点击“确定”。
![](http://upload-images.jianshu.io/upload_images/13092138-ba8ed8dd700c61e1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/194/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-e28c6031187aaa68.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/626/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-60898616fec479be.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/637/format/webp)
2.5 增加目录Add
如果在你的工作过程中你创建了新的文件或目录,那么你需要把他们加入你的版本控制中。选择那个文件或目录,使用“TortoiseSVN->添加(Add)”。
![](http://upload-images.jianshu.io/upload_images/13092138-2d8c817235b5fd45.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/682/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-8c760bebc0c7914c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/470/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-2ea5d448f0b9ed82.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/655/format/webp)
选中,检出的文档,右键-选择“SVN提交”
![](http://upload-images.jianshu.io/upload_images/13092138-4b0d2652096cce7e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/554/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-57790b61b92dc54a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/607/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-3b26291f371ba99d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/667/format/webp)
2.6 增加文件Add
增加文件的步骤与增加目录类似,选择要增加的文件,点击右键,选择“TortoiseSVN->增加”。然后选择菜单“SVN提交”。
![](http://upload-images.jianshu.io/upload_images/13092138-7eb62a4e52b3a798.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/660/format/webp)
2.7 删除目录或文件Delete
通过“删除”命令删除或者直接在工作副本中删除
![](http://upload-images.jianshu.io/upload_images/13092138-06bf651ecaf6eaee.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/836/format/webp)
使用“SVN提交”使删除操作生效。
![](http://upload-images.jianshu.io/upload_images/13092138-4b0d2652096cce7e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/554/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-109655cdbf50c3e7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/616/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-0b2f8b59ba0b29de.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/663/format/webp)
2.8 修改文件提交
当你修改文件后,保存,需要提交时,
1 修改里面的一个文件
![](http://upload-images.jianshu.io/upload_images/13092138-1a61534298b9bd68.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/554/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-46f966591885f2a2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/618/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-8e32ea610039b76f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/660/format/webp)
2.9 SVN 提交 commit
如果你的工作副本是最新的,并且没有冲突,你就已经为提交做好准备了,选择你要提交的文件和/或文件夹,然后“TortoiseSVN->提交...”
具体操作参见2.5、2.6、2.7、2.8节内容。
2.10 版本回溯Revision
![](http://upload-images.jianshu.io/upload_images/13092138-09e3667db36c36c4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/841/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-d8d1f9ca9769300e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-6d3e77a02ddffc5d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/666/format/webp)
2.11 版本同步Update
![](http://upload-images.jianshu.io/upload_images/13092138-f39fca369c4a2469.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/516/format/webp)
2.12 操作流程
第一次使用SVN的基本流程如下:
1) 您首先要让SVN管理员给您分配一个用户名和密码,使用它来登录(Login)到SVN服务器。
2) 在本地硬盘上创建一个工作目录(工作副本)。
3) 从SVN服务器的仓库(Repository)导出(Checkout)目录到本地硬盘的工作目录
4) 从SVN服务器同步(Update)你同事的修改到你本地工作目录。在工作目录上进行工作,在这个过程中,把文件的中间版本(Revision)提交(Commit)给SVN服务器。
2.13 文件冲突 clean
![](http://upload-images.jianshu.io/upload_images/13092138-6be4299303f5cb57.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/825/format/webp)
![](http://upload-images.jianshu.io/upload_images/13092138-47f37d33bd1abdff.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/455/format/webp)