# Apache Subversion

**Apache Subversion**（SVN）是一个开源、集中式的版本控制系统，它在中央仓库中记录文件与目录的完整历史，每位开发者从中检出一份本地工作副本。它由 CollabNet 公司于 2000 年创立，最初的设计目标是做一个更好的 CVS，其基本模型、设计与接口至今仍深受这一目标的影响。<sup>[1](https://subversion.apache.org/)</sup><sup> • </sup><sup>[2](https://subversion.apache.org/features.html)</sup>

| 关键事实 | 说明 |
|---|---|
| 模型 | 集中式版本控制：全体成员面向远程服务器上的单一中央仓库工作；检出（checkout）会在用户机器上生成一份工作副本<sup>[3](https://www.git-tower.com/learn/git/ebook/en/command-line/appendix/from-subversion-to-git/)</sup> |
| 起源 | 由 CollabNet 公司于 2000 年创立；以 Apache 许可证 2.0 版发布<sup>[1](https://subversion.apache.org/)</sup><sup> • </sup><sup>[4](https://subversion.apache.org/docs/community-guide/community-guide.html)</sup> |
| 首个版本 | Subversion 1.0.0，2004 年 2 月 23 日<sup>[5](https://subversion.apache.org/docs/release-notes/release-history.html)</sup> |
| 服务器选项 | 通过 `mod_dav_svn` 模块使用 Apache HTTP Server（WebDAV/DeltaV 协议）、独立的 `svnserve` 服务器，或直接以 `file://` 访问<sup>[6](https://subversion.apache.org/quick-start)</sup><sup> • </sup><sup>[2](https://subversion.apache.org/features.html)</sup> |
| 仓库后端 | FSFS，自 Subversion 1.2（2005 年）起为默认；Berkeley DB（BDB）后端在 1.0 与 1.1 中为默认，自 1.8（2013 年）起被弃用，并计划移除<sup>[7](https://subversion.apache.org/docs/release-notes/1.15)</sup><sup> • </sup><sup>[8](https://subversion.apache.org/faq)</sup> |
| 当前版本 | 1.14 是推荐的 LTS 系列（1.14.0 发布于 2020 年 5 月 27 日；1.14.5 发布于 2024 年 12 月 8 日）；1.15.0 于 2026 年 10 月 8 日首次发布，新增 Pristines On Demand、多种工作副本格式、流式检出（streamy checkout）与 CMake 支持<sup>[5](https://subversion.apache.org/docs/release-notes/release-history.html)</sup><sup> • </sup><sup>[9](https://subversion.apache.org/docs/release-notes/)</sup><sup> • </sup><sup>[7](https://subversion.apache.org/docs/release-notes/1.15)</sup> |

## 工作原理

[Subversion](https://www.edgepedia.org/zh/subversion) 由两个组件构成。仓库（repository）是一个版本控制数据库，通常位于服务器上，充当唯一的事实来源，以修订版本（revision）的形式保存受版本控制数据的完整历史。工作副本（working copy）则是用户本地的私有工作区：它看起来、用起来都像本地文件系统上的普通目录，却会追踪其中文件与目录的状态和变更——其根目录下有一个名为 `.svn` 的管理目录，存放 Subversion 所需的元数据。<sup>[6](https://subversion.apache.org/quick-start)</sup>

基本工作流程由此而来。`svn import` 把现有的未受版本控制的数据导入仓库；`svn checkout` 为某个主干、分支或标签创建工作副本；`svn update` 把他人提交的变更同步到工作副本；`svn commit` 把本地修改发布到中央仓库。工作副本可以切换到另一个开发分支；项目文档建议检出项目的某个子树而非整个仓库，因为一个仓库可以容纳若干个互不相关的项目。<sup>[6](https://subversion.apache.org/quick-start)</sup>

由于采用集中式模型，多数涉及状态或历史记录的操作都需要连接中央服务器。客户端保存自己想要改动的代码块，并把变更直接提交到服务器，服务器则持有仓库及其元数据。<sup>[10](https://www.techtarget.com/it-infrastructure/tip/The-differences-between-SVN-and-Git-that-matter)</sup>

## 特性

Subversion 的功能集是针对 CVS 定义的；在 Subversion 的设计所适用的范围内，它大体上达到或超过了 CVS 的功能。<sup>[2](https://subversion.apache.org/features.html)</sup>

- **受版本控制的目录与操作。** 目录与文件一样，是受版本控制的一等对象；复制、删除、重命名都是受版本控制的操作（重命名尚有一些怪异之处）。<sup>[2](https://subversion.apache.org/features.html)</sup>
- **属性（properties）。** 任意键值对形式的元数据都可以附加到任何文件或目录上，并随其所描述的对象一同受版本控制；属性也可以附加到某个修订版本本身，不过这类属性不受版本控制。<sup>[2](https://subversion.apache.org/features.html)</sup>
- **原子提交。** 在整个提交成功之前，提交的任何部分都不会生效。修订号按提交而非按文件计数，提交的日志信息附加在其修订版本上。<sup>[2](https://subversion.apache.org/features.html)</sup>
- **廉价的分支与标签。** 二者都以底层的复制操作实现，只占用很小且固定的空间。任何副本都是标签；若你开始在副本上提交，它就变成了分支。<sup>[2](https://subversion.apache.org/features.html)</sup>
- **合并追踪（merge tracking）。** 自 Subversion 1.5（2008 年 6 月 19 日）引入，可自动协助管理各条开发线之间的变更流动，以及把分支合并回其来源。<sup>[2](https://subversion.apache.org/features.html)</sup><sup> • </sup><sup>[5](https://subversion.apache.org/docs/release-notes/release-history.html)</sup>
- **文件锁定。** Subversion 支持但不强制锁定文件，以便在多人试图编辑同一文件时提醒用户。被标记为需要锁定的文件在取得锁之前以只读方式呈现。<sup>[2](https://subversion.apache.org/features.html)</sup>
- **网络选项。** Subversion 可以通过 Apache Web 服务器使用基于 HTTP 的 WebDAV/DeltaV 协议，也可以使用独立的 `svnserve` 服务器，后者使用一种自定义协议。<sup>[2](https://subversion.apache.org/features.html)</sup><sup> • </sup><sup>[8](https://subversion.apache.org/faq)</sup>

## 历史

CollabNet 于 2000 年启动 Subversion 项目，软件开发一年后便实现了自托管（self-hosting）。<sup>[1](https://subversion.apache.org/)</sup><sup> • </sup><sup>[8](https://subversion.apache.org/faq)</sup> 1.0.0 版于 2004 年 2 月 23 日发布，随后是 2004 年 9 月的 1.1.0 和 2005 年 5 月的 1.2.0。<sup>[5](https://subversion.apache.org/docs/release-notes/release-history.html)</sup> 项目于 2009 年 11 月 7 日被接纳进入 Apache 孵化器（Apache Incubator），这是成为 Apache 顶级项目的第一步，并于 2010 年成为顶级项目。<sup>[11](https://subversion.apache.org/news)</sup>

发布策略区分 LTS 系列与常规系列：1.0 至 1.10 以及 1.14 为 LTS 版本，1.11、1.12、1.13 为常规版本，支持六个月，而 LTS 系列支持四年。<sup>[12](https://subversion.apache.org/roadmap.html)</sup> 2020 年 5 月 27 日发布的 Subversion 1.14 是所有早期版本的超集，只增加函数，从而保持 API/ABI 兼容性；其服务器可以读写早期版本创建的仓库，无需导出再重新导入（dump-and-reload）式的升级。<sup>[13](https://subversion.apache.org/docs/release-notes/1.14.html)</sup> 1.14.5 缺陷修复与安全版本随后于 2024 年 12 月 8 日发布。<sup>[5](https://subversion.apache.org/docs/release-notes/release-history.html)</sup>

## Subversion 1.15

Subversion 1.15 于 2026 年 10 月 8 日首次发布，引入了 Pristines On Demand，可将工作副本的存储需求最多降低 50%。默认情况下，`.svn` 管理目录会缓存每个文件 BASE 修订版本（即“原始副本”，pristine）的副本，以便 diff 与 revert 能离线工作，但提交变更需要访问仓库；使用 `--store-pristine=no` 时，Subversion 改为只在需要时从服务器获取原始副本，以额外的网络通信换取本地磁盘空间。<sup>[6](https://subversion.apache.org/quick-start)</sup> 该特性适合体积很大而变动不频繁的文件、连接速度快但存储受限的设备，以及仓库与工作副本位于同一设备的情形。<sup>[7](https://subversion.apache.org/docs/release-notes/1.15)</sup>

该版本还新增了 Multi-WC，即对多种工作副本格式版本的支持：随 Subversion 1.8 引入、1.8 至 1.15 客户端均可使用的格式 31，以及新的格式 32——Pristines On Demand 需要格式 32，且只有 1.15 及更新版本的客户端才能使用。默认情况下，检出与升级仍生成格式 31 的工作副本，以获得最大兼容性。流式检出与对 CMake 构建的支持使该版本更趋完整。<sup>[7](https://subversion.apache.org/docs/release-notes/1.15)</sup><sup> • </sup><sup>[9](https://subversion.apache.org/docs/release-notes/)</sup>

1.15 还警告说，自 2013 年 Subversion 1.8 起被弃用的 [Berkeley DB](https://www.edgepedia.org/zh/berkeley-db) 仓库后端，计划在未来的某个发布系列中移除，并建议管理员把以 BDB 为后端的仓库迁移到 FSFS。<sup>[7](https://subversion.apache.org/docs/release-notes/1.15)</sup>

## Subversion 与 Git

最鲜明的对比在于架构。Git 是分布式版本控制系统：用户不是检出一份工作副本，而是克隆仓库，得到一个包含项目全部历史的完整本地仓库。Subversion 的检出则生成一份工作副本，即某个特定版本的快照，历史仍留在中央服务器上。<sup>[3](https://www.git-tower.com/learn/git/ebook/en/command-line/appendix/from-subversion-to-git/)</sup> Git 的去中心化设计支持无需中央服务器的点对点交换，并以对象快照而非以文件为中心的方式存储变更。<sup>[10](https://www.techtarget.com/it-infrastructure/tip/The-differences-between-SVN-and-Git-that-matter)</sup>

在某些场景下，集中式仍有实际优势。SVN 在处理大型仓库和二进制文件、并重视更精细的访问控制的开发团队中找到了归宿；单一的中央仓库使得按路径指定读写权限成为可能，游戏开发工作室尤其继续青睐集中式模型。<sup>[10](https://www.techtarget.com/it-infrastructure/tip/The-differences-between-SVN-and-Git-that-matter)</sup><sup> • </sup><sup>[14](https://is.muni.cz/el/1433/jaro2010/PV226/um/technology/vcs/svn_vs_git.pdf)</sup>

互操作也得到良好支持。`git-svn` 工具可在 Subversion 仓库与 Git 之间双向传递变更集，跟踪标准的主干/分支/标签布局，让 Git 用户可以从 Subversion 获取内容，也能 dcommit 回去。<sup>[15](https://git-scm.com/docs/git-svn)</sup> GitHub 曾记录一条迁移路径：用 `git svn clone` 把 Subversion 仓库转换为 Git 并推送结果；不过 GitHub 已于 2024 年 1 月 8 日移除 github.com 上对 Subversion 协议的支持，并引导用户改用 GitHub Importer 进行迁移。<sup>[16](https://docs.github.com/en/migrations/importing-source-code/using-the-command-line-to-import-source-code/importing-a-subversion-repository)</sup><sup> • </sup><sup>[17](https://github.blog/changelog/2024-01-08-subversion-has-been-sunset/)</sup> 若干曾使用 Subversion 的知名项目，包括 Rails 和 Jenkins，后来都迁移到了 Git；而一些大型 Git 仓库有时正是 Subversion 仓库的镜像。<sup>[18](https://gdr-gpl-2013-2024.imag.fr/sites/default/files/documentsGPL/JourneesNationales/GPL2016/Actes-GDR-GPL-2016.pdf)</sup>

## References

1. [Apache Subversion project home page](https://subversion.apache.org/)
2. [Apache Subversion Features](https://subversion.apache.org/features.html)
3. [Switching from Subversion to Git, Git Tower Learn ebook](https://www.git-tower.com/learn/git/ebook/en/command-line/appendix/from-subversion-to-git/)
4. [Apache Subversion Community Guide, General Overview](https://subversion.apache.org/docs/community-guide/community-guide.html)
5. [Subversion Release History](https://subversion.apache.org/docs/release-notes/release-history.html)
6. [Apache Subversion: Quick Start](https://subversion.apache.org/quick-start)
7. [Apache Subversion 1.15 Release Notes](https://subversion.apache.org/docs/release-notes/1.15)
8. [Apache Subversion FAQ](https://subversion.apache.org/faq)
9. [Apache Subversion Release Notes index](https://subversion.apache.org/docs/release-notes/)
10. [The differences between SVN and Git that matter, TechTarget](https://www.techtarget.com/it-infrastructure/tip/The-differences-between-SVN-and-Git-that-matter)
11. [Apache Subversion News Archives](https://subversion.apache.org/news)
12. [Apache Subversion Roadmap](https://subversion.apache.org/roadmap.html)
13. [Apache Subversion 1.14 LTS Release Notes](https://subversion.apache.org/docs/release-notes/1.14.html)
14. [Centralized vs. distributed version control systems, Masaryk University course notes](https://is.muni.cz/el/1433/jaro2010/PV226/um/technology/vcs/svn_vs_git.pdf)
15. [git-svn Documentation, git-scm.com](https://git-scm.com/docs/git-svn)
16. [Importing a Subversion repository, GitHub Docs](https://docs.github.com/en/migrations/importing-source-code/using-the-command-line-to-import-source-code/importing-a-subversion-repository)
17. [Subversion has been sunset, GitHub Changelog (8 January 2024)](https://github.blog/changelog/2024-01-08-subversion-has-been-sunset/)
18. [Actes GDR GPL 2016 (projects migrating from Subversion to Git)](https://gdr-gpl-2013-2024.imag.fr/sites/default/files/documentsGPL/JourneesNationales/GPL2016/Actes-GDR-GPL-2016.pdf)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Development tools and collaboration infrastructure › Version control and collaboration platforms

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/apache-subversion

English original: https://www.edgepedia.org/apache-subversion
