feat: add docs/subversion.md (#403)

This commit is contained in:
jaywcjlove 2023-08-24 14:12:47 +08:00
parent 91f81b4958
commit ca05decbc0
3 changed files with 225 additions and 1 deletions

View File

@ -155,11 +155,12 @@ Quick Reference
[Lsof](./docs/lsof.md)<!--rehype:style=background: rgb(16 185 129);-->
[Mitmproxy](./docs/mitmproxy.md)<!--rehype:style=background: rgb(4 92 135);-->
[Netcat](./docs/netcat.md)<!--rehype:style=background: rgb(4 92 135);-->
[Sed](./docs/sed.md)<!--rehype:style=background: rgb(16 185 129);-->
[OpenSSL](./docs/openssl.md)<!--rehype:style=background: rgb(114 20 18);-->
[ps](./docs/ps.md)<!--rehype:style=background: rgb(99 99 99);-->
[Sed](./docs/sed.md)<!--rehype:style=background: rgb(16 185 129);-->
[Systemd](./docs/systemd.md)<!--rehype:style=background: rgb(16 185 129);-->
[SSH](./docs/ssh.md)<!--rehype:style=background: rgb(99 99 99);-->
[Subversion (SVN)](./docs/subversion.md)<!--rehype:style=background: rgb(99 99 99);-->
[Screen](./docs/screen.md)<!--rehype:style=background: rgb(99 99 99);-->
[Sysdig](./docs/sysdig.md)<!--rehype:style=background: rgb(1 171 199);-->
[Tmux](./docs/tmux.md)<!--rehype:style=background: rgb(99 99 99);-->

3
assets/subversion.svg Normal file
View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 14 14" height="1em" width="1em">
<path d="M13 11.377V8.223c-1.643.648-3.681 1.278-6.115 1.893-2.267.573-4.229.986-5.885 1.238v.022h12zM1 8.038v2.566a51.332 51.332 0 0 0 5.065-.983c1.481-.374 2.623-.738 3.424-1.09.8-.351 1.17-.648 1.11-.89-.054-.21-.424-.318-1.109-.323-.351.005-.835.03-1.452.075-.618.045-1.387.117-2.305.213-1.425.152-2.608.269-3.55.348-.448.037-.842.066-1.183.085Zm.517 1.475c.03 0 .058.013.08.035a.116.116 0 0 1-.128.191.117.117 0 0 1-.037-.025.072.072 0 0 1-.025-.037c0-.008-.008-.023-.008-.045 0-.03.015-.06.037-.083.023-.022.053-.03.09-.03zm.406 0a.12.12 0 0 1 .082.035.115.115 0 0 1 .033.083c0 .033-.011.06-.034.084a.135.135 0 0 1-.135.024.097.097 0 0 1-.038-.025c-.014-.007-.022-.022-.03-.037-.007-.008-.007-.023-.007-.045 0-.03.007-.06.03-.083a.112.112 0 0 1 .082-.03zm-.405-.755c.03 0 .057.011.08.035.023.022.035.05.035.083 0 .031-.012.06-.035.082a.114.114 0 0 1-.082.035.114.114 0 0 1-.084-.035.115.115 0 0 1-.035-.082c0-.034.008-.062.03-.085a.117.117 0 0 1 .083-.034Zm.405 0c.031 0 .058.011.082.035.022.022.033.05.033.083 0 .031-.011.06-.034.082-.03.022-.053.035-.09.035a.106.106 0 0 1-.083-.035.118.118 0 0 1-.037-.082c0-.034.007-.062.03-.085a.116.116 0 0 1 .082-.034ZM13 3.299v2.406c-.818.05-1.84.138-3.069.267-1.245.135-2.26.24-3.046.307-.788.075-1.357.114-1.705.12-.682.016-1.045-.075-1.098-.277-.053-.224.353-.524 1.223-.885.87-.367 2.025-.735 3.45-1.095a43.649 43.649 0 0 1 4.244-.825zm-.428-.675a81.77 81.77 0 0 0-5.056 1.115C4.793 4.426 2.622 5.11 1 5.787V2.624h11.573z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

220
docs/subversion.md Normal file
View File

@ -0,0 +1,220 @@
Subversion 备忘清单
===
本备忘单总结了常用的 [SVN](https://git-scm.com/) 命令行指令,以供快速参考。
入门
---
### Subversion 组件
<!--rehype:wrap-class=row-span-2-->
名称 | 说明
:- | :-
`svn` | 命令行程序
`svnversion` | 工作副本的修订
`svnlook` | 检查存储库
`svnadmin` | 存储库管理
`svndumpfilter` | 过滤存储库流
`mod_dav_svn` | Apache 模块
`svnserve` | SVN服务器SVN协议
`svnsync` | 镜像仓库
<!--rehype:className=left-align-->
---
- [Subversion 官方文档](https://subversion.apache.org/)
### 添加文件或文件夹
```bash
$ svn add *
# 添加文件夹中的所有项目,然后递归(忽略版本目录)
$ svn add itemname
# 如果 itemname 是文件夹,
# 则所有子文件夹 并且文件也会被添加
$ svn add * --force
# 强制递归到版本化目录
```
### 将更改提交到存储库
```shell
$ svn commit "/path"
# 提交对文件或文件夹的更改
$ svn commit -m "Message" "/path"
# 提交消息“Message”
$ svn commit -N "/path"
# 提交对文件夹的更改而不递归
```
### Subversion 协议
协议 | 说明
:- | :-
`file://` | 本地
`http://` | HTTP (Apache)
`https://` | HTTPS (SSL)
`svn://` | SVN (svnserve)
`svn+ssh://` | SVN over SSH
<!--rehype:className=left-align-->
### 删除、复制和移动
```shell
$ svn delete "/path"
$ svn -m "Deleting" delete "/path"
# 删除并显示消息“正在删除”
$ svn copy "sourcepath" "targetpath"
# 将源复制到目标
$ svn move "sourcepath" "targetpath"
# 将源移动到目标
```
### 杂项命令 ($ svn ... )
<!--rehype:wrap-class=row-span-2-->
命令 | 说明
:- | :-
`$ svn resolve "/path"` | 解决冲突
`$ svn cleanup "/path"` | 递归删除,锁并完成,操作
`$ svn lock "/path"` | 锁定路径
`$ svn unlock "/path"` | 解锁路径
`$ svn cat "/path"` | 查看文件内容
`$ svn status "/path"` | 获取路径状态
<!--rehype:className=left-align-->
### Subversion 帮助
```shell
$ svn help
$ svn help import
# 显示“导入”命令的帮助
```
### 恢复本地(未提交)更改
```shell
$ svn revert "/path/filename"
# 恢复对文件的更改
$ svn revert -R "/path/folder"
# 递归恢复对文件夹的更改
```
### 日志与责任
```shell
$ svn log "/path"
# 显示存储库中的日志消息
$ svn blame "/path"
# 显示路径的带有消息的提交
```
### 将本地文件夹添加到存储库
```shell
$ svn import folder "/path/to/repository"
```
### 物品和财产状态
<!--rehype:wrap-class=row-span-2-->
命令 | 说明
:- | :-
' ' | 无修改
`A` | 添加
`D` | 删除
`M` | 修改的
`R` | 已更换物品
`C` | 冲突中
`X` | 外部定义
`I` | 被忽略
`?` | 不在存储库中
`!` | 物品缺失
`~` | 对象类型已更改
<!--rehype:className=left-align-->
### 存储库管理
```shell
$ svnadmin create "/path/to/repository"
# 创建存储库
$ svnadmin setlog "path" -r 7 message.txt
# 第7版的更改日志消息
# message.txt内容的“路径”
$ svnadmin dump "repository" > filename
# 将存储库的内容转储到文件
$ svnadmin load "repository" < filename
# 将文件的内容加载到存储库
```
### 文件之间的差异
```shell
$ svn diff "/path/file"
# 查看“/path/file”中的更改
$ svn diff "/path/file@2" "/path/file@7"
# 比较修订版2和7中的文件
$ svn diff -r 2:7 "/path/folder"
# 比较修订版2和7中的所有文件
```
### 签出工作副本
```shell
$ svn checkout "/path/to/repository/folder"
# 创建“文件夹”的工作副本
$ svn checkout "/path" foldername
# 签出到新文件夹“foldername”
```
### 合并更改
```shell
$ svn merge -r 2:7 "item" "/path/file"
# 在修订2之间应用差异
# 和“item”到“/path/file”的7
$ svn merge "url1" "url2" "/path/file"
# 应用“url1”和
# “url2”到“/path/file”
```
### 特性命令($ svn ... )
命令 | 说明
:- | :-
`$ svn proplist "/path"` | 列出属性
`$ svn propset PROP VAL` | 设置属性“PROP”
`$ svn "/path"` | 至值“VAL”
`$ svn propget PROP "/path"` | 获取“PROP”的值
`$ svn propedit PROP "/path"` | 编辑“PROP”
`$ svn propdel PROP "/path"` | 删除“PROP”
<!--rehype:className=left-align-->
### 参数快捷方式
参数 | 说明
:- | :-
`-m "Message"` | `--message`
`-q` | `--quiet`
`-v` | `--verbose`
`-r` | `--revision`
`-c` | `--change`
`-t` | `--transaction`
`-R` | `--recursive`
`-N` | `--non-recursive`
<!--rehype:className=left-align-->
### 从存储库更新工作副本
```shell
$ svn update "/path"
$ svn update -r9 "/path"
# 更新至修订版9
```
另见
---
- [Apache Subversion: Quick Start](https://subversion.apache.org/quick-start)
- [Subversion 与版本控制](https://svnbook.red-bean.com/)