第 2 章 基本使用

目录

1. 求助!
2. 导入数据到你的版本库
2.1. 导入文件和目录
2.2. 推荐的版本库布局
2.3. 名称中有什么?
3. 创建工作副本
4. 基本的工作循环
4.1. 更新你的工作副本
4.2. 开始修改
4.3. 检查你的修改
4.3.1. 查看你的修改概况
4.3.2. 检查你的本地修改的详情
4.4. 修正错误
4.5. 解决冲突
4.5.1. 交互式的查看冲突区别
4.5.2. 交互式的解决冲突区别
4.5.3. 延后解决冲突
4.5.4. 手工合并冲突
4.5.5. 丢弃你的修改而接收新获取的修订版本
4.5.6. Punting: using svn revert
4.6. 提交你的修改
5. 检验历史
5.1. 检查历史修改详情
5.1.1. 检查本地修改
5.1.2. 比较工作副本和版本库
5.1.3. 比较版本库中的版本
5.2. 产生历史修改列表
5.3. 浏览版本库
5.3.1. svn cat
5.3.2. svn list
5.4. 获得旧的版本库快照
6. 有时你只需要清理
6.1. 处理你的工作副本
6.2. 从中断中恢复
7. 处理结构性冲突
7.1. An Example Tree Conflict
8. 总结

Theory is useful, but its application is just plain fun. Let's move now into the details of using Subversion. By the time you reach the end of this chapter, you will be able to perform all the tasks you need to use Subversion in a normal day's work. You'll start with getting your files into Subversion, followed by an initial checkout of your code. We'll then walk you through making changes and examining those changes. You'll also see how to bring changes made by others into your working copy, examine them, and work through any conflicts that might arise.

This chapter will not provide exhaustive coverage of all of Subversion's commands—rather, it's a conversational introduction to the most common Subversion tasks that you'll encounter. This chapter assumes that you've read and understood 第 1 章 基本概念 and are familiar with the general model of Subversion. For a complete reference of all commands, see 第 9 章 Subversion 完全参考.

Also, this chapter assumes that the reader is seeking information about how to interact in a basic fashion with an existing Subversion repository. No repository means no working copy; no working copy means not much of interest in this chapter. There are many Internet sites which offer free or inexpensive Subversion repository hosting services. Or, if you'd prefer to set up and administer your own repositories, check out 第 5 章 版本库管理. But don't expect the examples in this chapter to work without the user having access to a Subversion repository.

Finally, any Subversion operation that contacts the repository over a network may potentially require that the user authenticate. For the sake of simplicity, our examples throughout this chapter avoid demonstrating and discussing authentication. Be aware that if you hope to apply the knowledge herein to an existing, real-world Subversion instance, you'll probably be forced to provide at least a username and password to the server. See 第 11.2 节 “客户端凭证” for a detailed description of Subversion's handling of authentication and client credentials.