美文网首页自动化
SVN 的 Windows 和 Linux 客户端操作详解

SVN 的 Windows 和 Linux 客户端操作详解

作者: 51reboot | 来源:发表于2017-11-13 17:33 被阅读129次

奋斗本就不是我们想的那么简单
你若没有一颗不渝之心
又怎能配的上说
你在奋斗?

Windows 客户端操作

安装 SVN 客户端

去官网下载 svn 软件包并安装:

验证安装是否成功

温馨提示,在虚拟机环境下安装 SVN,可能需要重启虚拟机才会有 “SVN

Checkout” 哟~

<section class="" style="margin: 10px 0px; padding: 0px; box-sizing: border-box;">

配置下载 SVN 内容

创建或选择本地的目录作为 svn 同步工作目录(自己可以随意指定),创建一个

新的目录为:“E:\yinzhengjie\workhome”,然后进入到该目录,右击鼠

标,选择 "SVN Checkout...",如下图:

设置 SVN 地址,如下图:

输入用户名与密码(SVN 配置文件【passwd】中定义的哟),并可以勾选保存,如下图:

温馨提示:

开始下载同步,如下图:

同步完成后,如果你的 SVN 目录中文件的左下角有一个带绿色的对勾表示下载 OK 了,如下图:

扩展小知识:

进度对话框使用颜色代码来高亮显示不同的提交行为。

  • 蓝色:提交一个修改

  • 紫色:提交一个新增项

  • 深红:提交一个删除或是替换

  • 黑色:所有其他项

这是默认的配合方案,但你可以通过设置对话框来定制这个颜色。

定期下载【update】 SVN 内容</section>

可能用过 SVN 的小伙伴都知道,每次到单位第一件事情就是同步数据,这样始终可以保持拿到的数据是最新的。 两年前,我在北龙中网工作时,就是用的 SVN 服务器,那也是我第一次接触 SVN 这个软件。

向 SVN 服务器提交数据

查看服务器文件

有可能本地的文件和服务器的文件不一致,在 update 的时候可以进行一个对比操作,还有就是上传完毕之后,建议要用以下的方法验证一下,看一下服务器的数据是否正常。

删除文件

查看 SVN 目录或文件的历史版本

在 SVN 客户端的工作目录中点击鼠标右键,选择 “TortoiseSVN”,然后选择 “Show log”,如下图:

在弹出的窗口列表中煤科院看到历次修改的注释信息

Linux 客户端操作</section>

导入 SVN 原始目录树

 1 [root@yinzhengjie ~]# mkdir -pv /data/yinzhengjie
 2 
 3 [root@yinzhengjie ~]# cd /data/yinzhengjie/
 4 
 5 [root@yinzhengjie yinzhengjie]# mkdir trunk branch tags -p
 6 
 7 [root@yinzhengjie yinzhengjie]#
 8 
 9 [root@yinzhengjie yinzhengjie]# tree /data/yinzhengjie/
10 
11 /data/yinzhengjie/
12 
13 ├── branch
14 
15 ├── tags
16 
17 └── trunk
18 
19  
20 
21 3 directories, 0 files
22 
23 [root@yinzhengjie yinzhengjie]#
24 [root@yinzhengjie yinzhengjie]# svn import svn://127.0.0.1/jky -m "import tree"
25 上面的属于网络的导入方式,也可以用本地的导入方式(可以里理解是windows的commit)
26 [root@yinzhengjie yinzhengjie]# svn import file:///yinzhengjie/application/svndata/jky/
27 可以用windows客户端进行验证一下。

从 SVN 库提取数据

 1 [root@yinzhengjie yinzhengjie]# mkdir -p /data/test/
 2 [root@yinzhengjie yinzhengjie]# cd /data/test/
 3 [root@yinzhengjie test]# ll
 4 total 0
 5 [root@yinzhengjie test]# 
 6 [root@yinzhengjie test]# svn checkout svn://127.0.0.1/jky /data/test/ --username yinzhengjie --password  123
 7 A    /data/test/trunk
 8 A    /data/test/branch
 9 A    /data/test/TortoiseSVN-1.9.5.27581-x64-svn-1.9.5.msi
10 A    /data/test/tags
11 Checked out revision 2.
12 [root@yinzhengjie test]# ll
13 total 17924
14 drwxr-xr-x 3 root root     4096 Sep 25 09:00 branch
15 drwxr-xr-x 3 root root     4096 Sep 25 09:00 tags
16 -rw-r--r-- 1 root root 18341888 Sep 25 09:00 TortoiseSVN-1.9.5.27581-x64-svn-1.9.5.msi
17 drwxr-xr-x 3 root root     4096 Sep 25 09:00 trunk
18 [root@yinzhengjie test]# 
19 [root@yinzhengjie test]# ll
20 total 17924
21 drwxr-xr-x 3 root root     4096 Sep 25 09:00 branch
22 drwxr-xr-x 3 root root     4096 Sep 25 09:00 tags
23 -rw-r--r-- 1 root root 18341888 Sep 25 09:00 TortoiseSVN-1.9.5.27581-x64-svn-1.9.5.msi
24 drwxr-xr-x 3 root root     4096 Sep 25 09:00 trunk
25 [root@yinzhengjie test]# 
26 [root@yinzhengjie test]# svn update svn://127.0.0.1/jky /data/test/ --username yinzhengjie --password  123
27 Skipped 'svn://127.0.0.1/jky'
28 A    /data/test/11111111111111111.jpg
29 Updated to revision 3.
30 Summary of conflicts:
31   Skipped paths: 1
32 [root@yinzhengjie test]# 
33 [root@yinzhengjie test]# svn co svn://127.0.0.1/jky /data/test/ 
34 Checked out revision 3.
35 [root@yinzhengjie test]# ll
36 total 17948
37 -rw-r--r-- 1 root root    21386 Sep 25 09:05 11111111111111111.jpg
38 drwxr-xr-x 3 root root     4096 Sep 25 09:00 branch
39 drwxr-xr-x 3 root root     4096 Sep 25 09:00 tags
40 -rw-r--r-- 1 root root 18341888 Sep 25 09:00 TortoiseSVN-1.9.5.27581-x64-svn-1.9.5.msi
41 drwxr-xr-x 3 root root     4096 Sep 25 09:00 trunk
42 [root@yinzhengjie test]#

查看 SVN 服务器中的数据

 1 [root@yinzhengjie test]# svn list --verbose svn://127.0.0.1/jky
 2       3 yinzheng              Sep 25 09:04 ./
 3       3 yinzheng        21386 Sep 25 09:04 11111111111111111.jpg
 4       1 yinzheng     18341888 Sep 25 07:55 TortoiseSVN-1.9.5.27581-x64-svn-1.9.5.msi
 5       2 yinzheng              Sep 25 08:49 branch/
 6       2 yinzheng              Sep 25 08:49 tags/
 7       2 yinzheng              Sep 25 08:49 trunk/
 8 [root@yinzhengjie test]# 
 9 [root@yinzhengjie test]# svn ls --verbose svn://127.0.0.1/jky
10       3 yinzheng              Sep 25 09:04 ./
11       3 yinzheng        21386 Sep 25 09:04 11111111111111111.jpg
12       1 yinzheng     18341888 Sep 25 07:55 TortoiseSVN-1.9.5.27581-x64-svn-1.9.5.msi
13       2 yinzheng              Sep 25 08:49 branch/
14       2 yinzheng              Sep 25 08:49 tags/
15       2 yinzheng              Sep 25 08:49 trunk/
16 [root@yinzhengjie test]# 
17 [root@yinzhengjie test]# svn --help

查看 SVN 服务器某个文件的内容

1 [root@yinzhengjie test]# svn cat  svn://127.0.0.1/jky/尹正杰博客.txt
2 http://www.cnblogs.com/yinzhengjie/
3 [root@yinzhengjie test]#

向 SVN 中提交数据

 1 [root@yinzhengjie ~]# cat /var/log/messages > /data/test/branch/test.log
 2 [root@yinzhengjie ~]# 
 3 [root@yinzhengjie ~]# svn add /data/test/branch/test.log 
 4 A         /data/test/branch/test.log
 5 [root@yinzhengjie ~]# 
 6 [root@yinzhengjie ~]# svn ci -m "upload test.log"
 7 svn: '/root' is not a working copy
 8 [root@yinzhengjie ~]# 
 9 [root@yinzhengjie ~]# cd /data/test/branch/
10 [root@yinzhengjie branch]# ll
11 total 4
12 -rw-r--r-- 1 root root 150 Sep 25 09:20 test.log
13 [root@yinzhengjie branch]# 
14 [root@yinzhengjie branch]# 
15 [root@yinzhengjie branch]# svn ci -m "upload test.log"
16 Adding         branch/test.log
17 Transmitting file data .
18 Committed revision 7.
19 [root@yinzhengjie branch]#

出处:http://www.cnblogs.com/yinzhengjie/p/7594811.html

微信号:Reboot51 后台回复 python、自动化、golang 即可获得相应课程的试听资料


运维自动化班 6 期报名开始

课程概述:

理论结合实战,使学员既可掌握快速从零构建一套实用、完整、可扩展的运维自动化平台。

深度结合使用流行的 Zabbix、Ansible、Git、Docker、Rancher、ELK 等开源框架与工具, 以为应用最广泛的 Django 框架为基础,构建一站式运维自动化平台。

通过深度剖析与二次开发定制,结合 REST API、运维流程化、运维可视化、运维平台化 思想来构造企业级的运维自动化解决方案。

在老师带领下大战 Zabbix、CMDB、集群自动化部署上线、*ELK 日志大数据分析、Docker *容器管理平台等多个最新实战,天天实战,招招实用。

上课模式:

网络直播班 线下面授班

咨询报名联系:

QQ(1):979950755 小月

QQ(2):279312229 ada

WeChat : 1902433859 小月

WeChat : 1251743084 小单

开课时间

12月10日(周日)

课程大纲 http://51reboot.com/course/devops/

相关文章

网友评论

    本文标题:SVN 的 Windows 和 Linux 客户端操作详解

    本文链接:https://www.haomeiwen.com/subject/umwzmxtx.html