101 words
1 minute
Using SVN
What Is SVN?
SVN is a file management tool similar to Git. Unlike Git, however, SVN is not distributed; it uses centralized management.
A server manages the code repository. SVN also provides finer-grained file access control than Git. In addition to checking out an entire repository, you can check out individual folders or files within it.
SVN Repositories
Before using SVN, you need a repository.
- Self-hosted repository
- Free online repository
SVN Clients
SVN is commonly used with graphical clients such as TortoiseSVN.
Using SVN from the Command Line
checkout
svn checkout svn://urlsvn checkout svn://url save-dirsvn checkout svn://url --username xxx --password xxxcommit
# 描述是必须的,但是可以填写空字符串,不指定svn commit -m "提交描述"# 只提交指定文件或目录svn commit /path/to/file-or-dir -m "提交指定文件"# 指定后缀的所有文件svn commit *.js -m "提交所有 js 文件"update
# 更新到最新svn update# 更新到指定版本的代码。特别是最新版本代码有问题时,我们可以用这个命令回到之前的版本svn update -r xxx# 仅更新指定文件或者目录svn up /path/to/file-or-diradd
# 添加指定文件或目录svn add /path/to/file-or-dir# 添加当前目录下所有 php 文件svn add *.phpdelete
svn delete /path/to/file-or-dir# 删除版本控制,但是本地依旧保留文件svn delete /path/to/file-or-dir --keep-locallog
# 查看当前目录的日志svn log# 查看指定文件或目录的提交日志svn log /path/to/file-or-dir# 查看日志,并且输出变动的文件列表svn log -v# 限定只输出最新的 5 条日志svn log -l 5diff
# 查看当前工作区的改动svn diff# 查看指定文件或目录的改动svn diff /path/to/file-or-dir# 本地文件跟指定版本号比较差异svn diff /path/to/file-or-dir -r xxx# 指定版本号比较差异svn diff /path/to/file-or-dir -r 1:2revert
# 撤销文件的本地修改svn revert test.php# 递归撤销目录中的本地修改svn revert -R /path/to/dirignore
# 忽略所有 log 文件。注意最后有个点号,表示在当前目录设置忽略属性。svn propset svn:ignore "*.log" .# 递归忽略 global-ignoressvn propset svn:global-ignores "*.log" .# 从文件读取忽略规则,一行一个规则。svn propset svn:ignore -F filename.txt .# 打开编辑器修改忽略属性svn propedit svn:ignore .# 查看当前目录的属性配置svn proplist . -v# 删除当前目录的忽略设置svn propdel svn:ignore .Command List
# statussvn statussvn status /path/to/file-or-dir
# cleanupsvn cleanup
# infosvn info
#lssvn lssvn ls -r 100
# catsvn cat test.py -r 2
# blamesvn blame filename.php
# change svn urlsvn switch --relocate old_url new_urlBranches
# 创建分支,从主干 trunk 创建一个分支保存到 branches/online1.0svn cp -m "描述内容" http://svnbucket.com/repos/trunk http://svnbucket.com/repos/branches/online1.0# 合并主干上的最新代码到分支上cd branches/online1.0svn merge http://svnbucket.com/repos/trunk# 分支合并到主干svn merge --reintegrate http://svnbucket.com/repos/branches/online1.0# 切换分支svn switch svn://svnbucket.com/test/branches/online1.0# 删除分支svn rm http://svnbucket.com/repos/branches/online1.0Help
# 查看SVN帮助svn help# 查看指定命令的帮助信息svn help commit Share
If this article helped you, please share it with others!
Some information may be outdated
Automatically Deploy an Angular Page with GitHub Actions
My Online Scam Experience 01 — Scam Analysis
Related Posts Smart
1
Getting Started with Docker
Study A practical Docker introduction covering containers vs. VMs, images, Docker Hub, core commands, persistent volumes, and Docker Compose.
2
Blog Migration – Mizuki Configuration Notes
Exploration Migrating from NotionNext to Mizuki with Bangumi integration, self-hosted Notion sync, R2 image persistence, and LLM-generated translations.
3
Automatically Deploy an Angular Page with GitHub Actions
Troubleshooting Deploy Angular to GitHub Pages with GitHub Actions, covering outputPath, angular-cli-ghpages, workflow setup, tokens, and the gh-pages branch.
4
Getting Started with VS Code Extension Development
Study Create a VS Code extension with Yeoman, then learn package.json, activationEvents, extension.ts, debugging, vsce packaging, and publishing.
5
Understanding Blockchain
Study Learn blockchain through blocks, distributed ledgers, and consensus: transaction flow, immutability, real-world uses, and scalability tradeoffs.
Random Posts Random
1
Interview Algorithm Study 1
Study 2023-08-11
2
Configure Docker + code-server on Alibaba Cloud to Build an Online IDE
Troubleshooting 2022-07-06
3
EOA Wallet Signature Verification and Related Topics
Exploration 2026-06-10
4
Basic On-Chain Operations for EOA Wallets
Exploration 2026-06-27
5
Missing Semester — Class 01
Study 2023-01-11





