Skip to content

Commit ca05dec

Browse files
committed
feat: add docs/subversion.md (jaywcjlove#403)
1 parent 91f81b4 commit ca05dec

File tree

3 files changed

+225
-1
lines changed

3 files changed

+225
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,12 @@ Quick Reference
155155
[Lsof](./docs/lsof.md)<!--rehype:style=background: rgb(16 185 129);-->
156156
[Mitmproxy](./docs/mitmproxy.md)<!--rehype:style=background: rgb(4 92 135);-->
157157
[Netcat](./docs/netcat.md)<!--rehype:style=background: rgb(4 92 135);-->
158-
[Sed](./docs/sed.md)<!--rehype:style=background: rgb(16 185 129);-->
159158
[OpenSSL](./docs/openssl.md)<!--rehype:style=background: rgb(114 20 18);-->
160159
[ps](./docs/ps.md)<!--rehype:style=background: rgb(99 99 99);-->
160+
[Sed](./docs/sed.md)<!--rehype:style=background: rgb(16 185 129);-->
161161
[Systemd](./docs/systemd.md)<!--rehype:style=background: rgb(16 185 129);-->
162162
[SSH](./docs/ssh.md)<!--rehype:style=background: rgb(99 99 99);-->
163+
[Subversion (SVN)](./docs/subversion.md)<!--rehype:style=background: rgb(99 99 99);-->
163164
[Screen](./docs/screen.md)<!--rehype:style=background: rgb(99 99 99);-->
164165
[Sysdig](./docs/sysdig.md)<!--rehype:style=background: rgb(1 171 199);-->
165166
[Tmux](./docs/tmux.md)<!--rehype:style=background: rgb(99 99 99);-->

assets/subversion.svg

+3
Loading

docs/subversion.md

+220
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
Subversion 备忘清单
2+
===
3+
4+
本备忘单总结了常用的 [SVN](https://git-scm.com/) 命令行指令,以供快速参考。
5+
6+
入门
7+
---
8+
9+
### Subversion 组件
10+
<!--rehype:wrap-class=row-span-2-->
11+
12+
名称 | 说明
13+
:- | :-
14+
`svn` | 命令行程序
15+
`svnversion` | 工作副本的修订
16+
`svnlook` | 检查存储库
17+
`svnadmin` | 存储库管理
18+
`svndumpfilter` | 过滤存储库流
19+
`mod_dav_svn` | Apache 模块
20+
`svnserve` | SVN服务器(SVN协议)
21+
`svnsync` | 镜像仓库
22+
<!--rehype:className=left-align-->
23+
24+
---
25+
26+
- [Subversion 官方文档](https://subversion.apache.org/)
27+
28+
### 添加文件或文件夹
29+
30+
```bash
31+
$ svn add *
32+
# 添加文件夹中的所有项目,然后递归(忽略版本目录)
33+
$ svn add itemname
34+
# 如果 itemname 是文件夹,
35+
# 则所有子文件夹 并且文件也会被添加
36+
$ svn add * --force
37+
# 强制递归到版本化目录
38+
```
39+
40+
### 将更改提交到存储库
41+
42+
```shell
43+
$ svn commit "/path"
44+
# 提交对文件或文件夹的更改
45+
$ svn commit -m "Message" "/path"
46+
# 提交消息“Message”
47+
$ svn commit -N "/path"
48+
# 提交对文件夹的更改而不递归
49+
```
50+
51+
### Subversion 协议
52+
53+
协议 | 说明
54+
:- | :-
55+
`file://` | 本地
56+
`http://` | HTTP (Apache)
57+
`https://` | HTTPS (SSL)
58+
`svn://` | SVN (svnserve)
59+
`svn+ssh://` | SVN over SSH
60+
<!--rehype:className=left-align-->
61+
62+
### 删除、复制和移动
63+
64+
```shell
65+
$ svn delete "/path"
66+
$ svn -m "Deleting" delete "/path"
67+
# 删除并显示消息“正在删除”
68+
$ svn copy "sourcepath" "targetpath"
69+
# 将源复制到目标
70+
$ svn move "sourcepath" "targetpath"
71+
# 将源移动到目标
72+
```
73+
74+
### 杂项命令 ($ svn ... )
75+
<!--rehype:wrap-class=row-span-2-->
76+
77+
命令 | 说明
78+
:- | :-
79+
`$ svn resolve "/path"` | 解决冲突
80+
`$ svn cleanup "/path"` | 递归删除,锁并完成,操作
81+
`$ svn lock "/path"` | 锁定路径
82+
`$ svn unlock "/path"` | 解锁路径
83+
`$ svn cat "/path"` | 查看文件内容
84+
`$ svn status "/path"` | 获取路径状态
85+
<!--rehype:className=left-align-->
86+
87+
### Subversion 帮助
88+
89+
```shell
90+
$ svn help
91+
$ svn help import
92+
# 显示“导入”命令的帮助
93+
```
94+
95+
### 恢复本地(未提交)更改
96+
97+
```shell
98+
$ svn revert "/path/filename"
99+
# 恢复对文件的更改
100+
$ svn revert -R "/path/folder"
101+
# 递归恢复对文件夹的更改
102+
```
103+
104+
### 日志与责任
105+
106+
```shell
107+
$ svn log "/path"
108+
# 显示存储库中的日志消息
109+
$ svn blame "/path"
110+
# 显示路径的带有消息的提交
111+
```
112+
113+
### 将本地文件夹添加到存储库
114+
115+
```shell
116+
$ svn import folder "/path/to/repository"
117+
```
118+
119+
### 物品和财产状态
120+
<!--rehype:wrap-class=row-span-2-->
121+
122+
命令 | 说明
123+
:- | :-
124+
' ' | 无修改
125+
`A` | 添加
126+
`D` | 删除
127+
`M` | 修改的
128+
`R` | 已更换物品
129+
`C` | 冲突中
130+
`X` | 外部定义
131+
`I` | 被忽略
132+
`?` | 不在存储库中
133+
`!` | 物品缺失
134+
`~` | 对象类型已更改
135+
<!--rehype:className=left-align-->
136+
137+
### 存储库管理
138+
139+
```shell
140+
$ svnadmin create "/path/to/repository"
141+
# 创建存储库
142+
$ svnadmin setlog "path" -r 7 message.txt
143+
# 第7版的更改日志消息
144+
# message.txt内容的“路径”
145+
$ svnadmin dump "repository" > filename
146+
# 将存储库的内容转储到文件
147+
$ svnadmin load "repository" < filename
148+
# 将文件的内容加载到存储库
149+
```
150+
151+
### 文件之间的差异
152+
153+
```shell
154+
$ svn diff "/path/file"
155+
# 查看“/path/file”中的更改
156+
$ svn diff "/path/file@2" "/path/file@7"
157+
# 比较修订版2和7中的文件
158+
$ svn diff -r 2:7 "/path/folder"
159+
# 比较修订版2和7中的所有文件
160+
```
161+
162+
### 签出工作副本
163+
164+
```shell
165+
$ svn checkout "/path/to/repository/folder"
166+
# 创建“文件夹”的工作副本
167+
$ svn checkout "/path" foldername
168+
# 签出到新文件夹“foldername”
169+
```
170+
171+
### 合并更改
172+
173+
```shell
174+
$ svn merge -r 2:7 "item" "/path/file"
175+
# 在修订2之间应用差异
176+
# 和“item”到“/path/file”的7
177+
$ svn merge "url1" "url2" "/path/file"
178+
# 应用“url1”和
179+
# “url2”到“/path/file”
180+
```
181+
182+
### 特性命令($ svn ... )
183+
184+
命令 | 说明
185+
:- | :-
186+
`$ svn proplist "/path"` | 列出属性
187+
`$ svn propset PROP VAL` | 设置属性“PROP”
188+
`$ svn "/path"` | 至值“VAL”
189+
`$ svn propget PROP "/path"` | 获取“PROP”的值
190+
`$ svn propedit PROP "/path"` | 编辑“PROP”
191+
`$ svn propdel PROP "/path"` | 删除“PROP”
192+
<!--rehype:className=left-align-->
193+
194+
### 参数快捷方式
195+
196+
参数 | 说明
197+
:- | :-
198+
`-m "Message"` | `--message`
199+
`-q` | `--quiet`
200+
`-v` | `--verbose`
201+
`-r` | `--revision`
202+
`-c` | `--change`
203+
`-t` | `--transaction`
204+
`-R` | `--recursive`
205+
`-N` | `--non-recursive`
206+
<!--rehype:className=left-align-->
207+
208+
### 从存储库更新工作副本
209+
210+
```shell
211+
$ svn update "/path"
212+
$ svn update -r9 "/path"
213+
# 更新至修订版9
214+
```
215+
216+
另见
217+
---
218+
219+
- [Apache Subversion: Quick Start](https://subversion.apache.org/quick-start)
220+
- [Subversion 与版本控制](https://svnbook.red-bean.com/)

0 commit comments

Comments
 (0)