+ All Categories
Home > Documents > Pragmatic Version Control

Pragmatic Version Control

Date post: 19-Jan-2022
Category:
Upload: others
View: 9 times
Download: 0 times
Share this document with a friend
4
Extracted from: Pragmatic Version Control using Subversion, 2nd Edition This PDF file contains pages extracted from Pragmatic Version Control, one of the Pragmatic Starter Kit series of books for project teams. For more information, visit http://www.pragmaticprogrammer.com/starter_kit. Note: This extract contains some colored text (particularly in code listing). This is available only in online versions of the books. The printed versions are black and white. Pagination might vary between the online and printer versions; the content is otherwise identical. Copyright © 2005 The Pragmatic Programmers, LLC. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior consent of the publisher.
Transcript
Page 1: Pragmatic Version Control

Extracted from:

Pragmatic Version Controlusing Subversion, 2nd Edition

This PDF file contains pages extracted from Pragmatic Version Control, one

of the Pragmatic Starter Kit series of books for project teams. For more

information, visit http://www.pragmaticprogrammer.com/starter_kit.

Note: This extract contains some colored text (particularly in code listing).

This is available only in online versions of the books. The printed versions

are black and white. Pagination might vary between the online and printer

versions; the content is otherwise identical.

Copyright © 2005 The Pragmatic Programmers, LLC.

All rights reserved.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any

form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the

prior consent of the publisher.

Page 2: Pragmatic Version Control

ContentsPreface x

1 Introduction 1

1.1 Version Control in Action . . . . . . . . . . . . . 2

1.2 Road Map . . . . . . . . . . . . . . . . . . . . . . 6

1.3 Why Choose Subversion . . . . . . . . . . . . . . 6

2 What is Version Control? 9

2.1 The Repository . . . . . . . . . . . . . . . . . . . 9

2.2 What Should We Store? . . . . . . . . . . . . . . 11

2.3 Working Copies and Manipulating Files . . . . . 12

2.4 Projects, Directories, and Files . . . . . . . . . . 15

2.5 Where Do Versions Come In? . . . . . . . . . . . 16

2.6 Tags . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.7 Branches . . . . . . . . . . . . . . . . . . . . . . 19

2.8 Merging . . . . . . . . . . . . . . . . . . . . . . . 22

2.9 Locking Options . . . . . . . . . . . . . . . . . . 23

2.10 Configuration Management (CM) . . . . . . . . . 26

3 Getting Started with Subversion 28

3.1 Installing Subversion . . . . . . . . . . . . . . . 28

3.2 Creating a Repository . . . . . . . . . . . . . . . 33

3.3 Creating a Simple Project . . . . . . . . . . . . . 34

3.4 Starting to Work with a Project . . . . . . . . . . 37

3.5 Making Changes . . . . . . . . . . . . . . . . . . 39

3.6 Updating the Repository . . . . . . . . . . . . . . 41

3.7 When Worlds Collide . . . . . . . . . . . . . . . . 44

3.8 Conflict Resolution . . . . . . . . . . . . . . . . . 47

Page 3: Pragmatic Version Control

CONTENTS viii

4 How To... 52

4.1 Our Basic Philosophy . . . . . . . . . . . . . . . 53

4.2 Important Steps When Using Version Control . 53

5 Accessing a Repository 55

5.1 Network Protocols . . . . . . . . . . . . . . . . . 55

5.2 Choosing a Networking Option . . . . . . . . . . 60

6 Common Subversion Commands 62

6.1 Checking Things Out . . . . . . . . . . . . . . . 62

6.2 Keeping Up-to-Date . . . . . . . . . . . . . . . . 64

6.3 Adding Files and Directories . . . . . . . . . . . 66

6.4 Properties . . . . . . . . . . . . . . . . . . . . . . 66

6.5 Copying and Moving Files and Directories . . . 75

6.6 Seeing What Has Changed . . . . . . . . . . . . 80

6.7 Handling Merge Conflicts . . . . . . . . . . . . . 86

6.8 Committing Changes . . . . . . . . . . . . . . . 91

6.9 Examining Change History . . . . . . . . . . . . 91

6.10 Removing a Change . . . . . . . . . . . . . . . . 95

7 File Locking and Binary Files 99

7.1 File Locking Overview . . . . . . . . . . . . . . . 99

7.2 File Locking in Practice . . . . . . . . . . . . . . 100

7.3 When to use Locking . . . . . . . . . . . . . . . . 106

8 Organizing Your Repository 107

8.1 A Simple Project . . . . . . . . . . . . . . . . . . 107

8.2 Multiple Projects . . . . . . . . . . . . . . . . . . 108

8.3 Multiple Repositories . . . . . . . . . . . . . . . 109

9 Using Tags and Branches 111

9.1 Tags and Branches . . . . . . . . . . . . . . . . . 112

9.2 Creating a Release Branch . . . . . . . . . . . . 115

9.3 Working in a Release Branch . . . . . . . . . . . 117

9.4 Generating a Release . . . . . . . . . . . . . . . 119

9.5 Fixing Bugs in a Release Branch . . . . . . . . . 121

9.6 Developer Experimental Branches . . . . . . . . 124

9.7 Working with Experimental Code . . . . . . . . 126

9.8 Merging the Experimental Branch . . . . . . . . 126

Page 4: Pragmatic Version Control

CONTENTS ix

10 Creating a Project 128

10.1 Creating the Initial Project . . . . . . . . . . . . 129

10.2 Structure within the Project . . . . . . . . . . . 131

10.3 Sharing Code between Projects . . . . . . . . . . 135

11 Third-Party Code 141

11.1 Binary Libraries . . . . . . . . . . . . . . . . . . 141

11.2 Libraries with Source Code . . . . . . . . . . . . 144

11.3 Keyword Expansion during Imports . . . . . . . 150

A Install, Network, Secure, and Administer 151

A.1 Installing Subversion . . . . . . . . . . . . . . . 151

A.2 Networking with svnserve . . . . . . . . . . . . . 153

A.3 Networking with svn+ssh . . . . . . . . . . . . . 154

A.4 Networking with Apache . . . . . . . . . . . . . . 157

A.5 Securing Subversion . . . . . . . . . . . . . . . . 163

A.6 Backing Up Your Repository . . . . . . . . . . . 170

B Migrating to Subversion 174

B.1 Getting cvs2svn . . . . . . . . . . . . . . . . . . . 175

B.2 Choosing How Much to Convert . . . . . . . . . 175

B.3 Converting Your Repository . . . . . . . . . . . . 176

C Third-Party Subversion Tools 178

C.1 TortoiseSVN . . . . . . . . . . . . . . . . . . . . . 178

C.2 IDE Integration . . . . . . . . . . . . . . . . . . . 185

C.3 Other Tools . . . . . . . . . . . . . . . . . . . . . 186

D Advanced Topics 188

D.1 Programmatic Access to Subversion . . . . . . . 188

D.2 Advanced Repository Management . . . . . . . 193

E Command Summary and Recipes 197

E.1 Subversion Command Summary . . . . . . . . . 197

E.2 Recipes . . . . . . . . . . . . . . . . . . . . . . . 208

F Other Resources 214

F.1 Online Resources . . . . . . . . . . . . . . . . . . 214

F.2 Bibliography . . . . . . . . . . . . . . . . . . . . 215


Recommended