Version Control with Subversion for Subversion 1.1 (Book Compiled from Revision 1337)
Total Page:16
File Type:pdf, Size:1020Kb
Version Control with Subversion For Subversion 1.1 (book compiled from Revision 1337) Ben Collins-Sussman Brian W. Fitzpatrick C. Michael Pilato Version Control with Subversion: For Subversion 1.1: (book com- piled from Revision 1337) by Ben Collins-Sussman, Brian W. Fitzpatrick, and C. Michael Pilato Published (TBA) Copyright © 2002, 2003, 2004, 2005 Ben Collins-SussmanBrian W. FitzpatrickC. Michael Pilato This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. Table of Contents Foreword......................................................................................................................................11 Preface.........................................................................................................................................13 Audience ..............................................................................................................................13 How to Read this Book ........................................................................................................... 13 Conventions Used in This Book ................................................................................................ 14 TypographicConventions ................................................................................................14 Icons ...........................................................................................................................14 Organization of This Book ....................................................................................................... 15 New in Subversion 1.1 ............................................................................................................ 16 ThisBookisFree ...................................................................................................................17 Acknowledgments ..................................................................................................................17 From Ben Collins-Sussman ..............................................................................................17 From Brian W. Fitzpatrick ............................................................................................... 18 From C. Michael Pilato ................................................................................................... 18 1.Introduction ...............................................................................................................................1 What is Subversion? ...............................................................................................................1 Subversion'sHistory ...............................................................................................................1 Subversion'sFeatures ..............................................................................................................2 Subversion'sArchitecture ........................................................................................................3 InstallingSubversion ..............................................................................................................4 Subversion'sComponents ........................................................................................................5 AQuickStart ........................................................................................................................5 2.BasicConcepts ...........................................................................................................................8 TheRepository ......................................................................................................................8 VersioningModels .................................................................................................................8 The Problem of File-Sharing ............................................................................................ 9 The Lock-Modify-Unlock Solution ....................................................................................9 The Copy-Modify-Merge Solution ....................................................................................11 Subversion in Action ..............................................................................................................12 WorkingCopies .............................................................................................................13 Revisions......................................................................................................................15 How Working Copies Track the Repository ........................................................................ 17 The Limitations of Mixed Revisions .................................................................................. 18 Summary..............................................................................................................................18 3.GuidedTour ..............................................................................................................................19 Help! ...................................................................................................................................19 Import..................................................................................................................................19 Revisions: Numbers, Keywords, and Dates, Oh My! ..................................................................... 19 RevisionNumbers ..........................................................................................................19 RevisionKeywords ........................................................................................................19 RevisionDates ..............................................................................................................20 InitialCheckout .....................................................................................................................22 Basic Work Cycle ..................................................................................................................23 Update Your Working Copy ............................................................................................. 24 Make Changes to Your Working Copy ............................................................................... 24 Examine Your Changes ...................................................................................................26 Resolve Conflicts (Merging Others' Changes) ...................................................................... 31 Commit Your Changes ....................................................................................................34 ExaminingHistory .................................................................................................................35 svnlog .........................................................................................................................35 svndiff ........................................................................................................................37 svncat .........................................................................................................................38 svnlist .........................................................................................................................39 iv Version Control with Subversion A Final Word on History ................................................................................................. 39 Other Useful Commands .........................................................................................................39 svncleanup ...................................................................................................................40 svnimport ....................................................................................................................40 Summary..............................................................................................................................40 4. Branching and Merging ............................................................................................................... 42 What'saBranch? ...................................................................................................................42 UsingBranches .....................................................................................................................42 Creating a Branch ..........................................................................................................44 Working with Your Branch .............................................................................................. 46 The Key Concepts Behind Branches .................................................................................. 48 Copying Changes Between Branches ......................................................................................... 48 Copying Specific Changes ...............................................................................................48 The Key Concept Behind Merging .................................................................................... 51 Best Practices for Merging ............................................................................................... 51 CommonUse-Cases ...............................................................................................................54