Version Control with Subversion Revision 10061
Total Page:16
File Type:pdf, Size:1020Kb
Version Control with Subversion Revision 10061 by Ben Collins-Sussman, Brian W. Fitzpatrick, and C. Michael Pilato Version Control with Subversion: Revision 10061 by Ben Collins-Sussman, Brian W. Fitzpatrick, and C. Michael Pilato Published (TBA) Copyright © 2002, 2003, 2004 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...................................................................................................................................... Preface......................................................................................................................................... Audience ..............................................................................................................................13 How to Read this Book ........................................................................................................... 13 Conventions Used in This Book ................................................................................................ 14 TypographicConventions ................................................................................................14 Icons ...........................................................................................................................14 Organization of This Book ....................................................................................................... 15 ThisBookisFree ...................................................................................................................16 Acknowledgments ..................................................................................................................16 From Ben Collins-Sussman ..............................................................................................16 From Brian W. Fitzpatrick ............................................................................................... 17 From C. Michael Pilato ................................................................................................... 17 1.Introduction ............................................................................................................................... What is Subversion? ...............................................................................................................1 Subversion'sHistory ...............................................................................................................1 Subversion'sFeatures ..............................................................................................................2 Subversion'sArchitecture ........................................................................................................3 InstallingSubversion ..............................................................................................................4 Subversion'sComponents ........................................................................................................5 AQuickStart ........................................................................................................................5 2.BasicConcepts ........................................................................................................................... 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......................................................................................................................16 How Working Copies Track the Repository ........................................................................ 18 The Limitations of Mixed Revisions .................................................................................. 18 Summary..............................................................................................................................19 3.GuidedTour .............................................................................................................................. Help! ...................................................................................................................................20 Import..................................................................................................................................20 Revisions: Numbers, Keywords, and Dates, Oh My! ..................................................................... 20 RevisionNumbers ..........................................................................................................20 RevisionKeywords ........................................................................................................20 RevisionDates ..............................................................................................................21 InitialCheckout .....................................................................................................................22 Basic Work Cycle ..................................................................................................................24 Update Your Working Copy ............................................................................................. 25 Make Changes to Your Working Copy ............................................................................... 25 Examine Your Changes ...................................................................................................26 Resolve Conflicts (Merging Others' Changes) ...................................................................... 31 Commit Your Changes ....................................................................................................34 ExaminingHistory .................................................................................................................35 svnlog .........................................................................................................................36 svndiff ........................................................................................................................37 svncat .........................................................................................................................38 svnlist .........................................................................................................................39 A Final Word on History ................................................................................................. 39 iv Version Control with Subversion Other Useful Commands .........................................................................................................39 svncleanup ...................................................................................................................39 svnimport ....................................................................................................................40 Summary..............................................................................................................................40 4. Branching and Merging ............................................................................................................... What'saBranch? ...................................................................................................................41 UsingBranches .....................................................................................................................41 Creating a Branch ..........................................................................................................43 Working with Your Branch .............................................................................................. 45 The Key Concepts Behind Branches .................................................................................. 46 Copying Changes Between Branches ......................................................................................... 47 Copying Specific Changes ...............................................................................................47 Best Practices for Merging ............................................................................................... 49 Common Use-Cases for Merging .............................................................................................. 51 Merging a Whole Branch to Another .................................................................................. 51 UndoingChanges ...........................................................................................................53 Resurrecting Deleted Items ..............................................................................................54