104 words
1 minute
Using SVN
What is SVN
SVN is a version control system similar to Git. However, unlike Git, SVN is not distributed; instead, it uses a central server to manage the code repository. At the same time, SVN provides finer-grained file security management than Git, allowing you to checkout not only an entire repository but also a specific folder or file within the repository.
SVN Repositories
Before using SVN, you need to have a repository.
- Self-hosted repositories
- Free online repositories
SVN Client
SVN tends to favor graphical clients, such as TortoiseSVN.
SVN Command-Line Usage
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
Related Posts Smart
1
Blog Migration - Mizuki Configuration Records
infra A record of the migration from NotionNext to Mizuki, mainly due to NotionNext's limitations. Mizuki was chosen for its lightweight nature and good balance of features, supporting diaries and project showcases. The configuration process is simple, with content controlled via md and ts files, and it also connects to the Bangumi API. The plan is to synchronize Notion content via CI, implement multilingual support, and address the issue of image links expiring.
2
Automatically Deploy Angular Pages with GitHub Actions
infra This post explains how to configure an Angular project for automatic deployment to GitHub Pages, including modifying the outputPath in angular.json, installing angular-cli-ghpages, creating a GitHub Actions workflow to build and deploy on pushes to a specific branch, and generating the token required to access the repository. Finally, it sets the GitHub Pages branch to gh-pages.
3
Uploading Large Files to GitHub
infra To upload large files to GitHub, you need to install Git Large File Storage (LFS) and configure it in the local Git repository. The process includes installing LFS, setting up pointers to track large files, and uploading the files with the corresponding commands. After completing these steps, large files can be uploaded to GitHub successfully.
4
Getting Started with Docker
infra Docker is a technology for solving microservice deployment problems by packaging applications and their dependencies into isolated containers, avoiding inconsistent environments and dependency conflicts. Compared with virtual machines, Docker starts faster and uses fewer resources. Its architecture includes images and containers, and users can share and obtain images through Docker Hub. Basic operations include creating and managing images and containers and using volumes for data persistence and host-container decoupling. Docker Compose can simplify distributed application deployment.
5
The First Round of Selection in the New Era
life With the development of AI technology, the cost of using advanced models may lead to social stratification, where only those with strong financial means can use these models. Although current prices are still acceptable, future price increases may make them unaffordable for most people, thus forming the first round of selection. The author feels anxious about this phenomenon, while also realizing that AI applications have moved beyond programming and into broader industries. Facing the challenges and opportunities of a new world, individuals continue to explore under the momentum of the times.





