Svn-Book.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
Version Control with Subversion For Subversion 1.7 (Compiled from r6046) Ben Collins-Sussman Brian W. Fitzpatrick C. Michael Pilato Version Control with Subversion: For Subversion 1.7: (Compiled from r6046) by Ben Collins-Sussman, Brian W. Fitzpatrick, and C. Michael Pilato Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ben Collins-Sussman, Brian W. Fitzpatrick, C. 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 .............................................................................................................................................................. xi Preface ............................................................................................................................................................... xiii What Is Subversion? .................................................................................................................................... xiii Is Subversion the Right Tool? ............................................................................................................... xiii Subversion's History ............................................................................................................................. xiv Subversion's Architecture ....................................................................................................................... xv Subversion's Components ..................................................................................................................... xvii What's New in Subversion ................................................................................................................... xvii Audience .................................................................................................................................................. xviii How to Read This Book ............................................................................................................................... xix Organization of This Book ............................................................................................................................. xx This Book Is Free ........................................................................................................................................ xxi Acknowledgments ........................................................................................................................................ xxi 1. Fundamental Concepts ......................................................................................................................................... 1 Version Control Basics .................................................................................................................................... 1 The Repository ...................................................................................................................................... 1 The Working Copy ................................................................................................................................. 2 Versioning Models ................................................................................................................................. 2 Version Control the Subversion Way ................................................................................................................. 7 Subversion Repositories ........................................................................................................................... 7 Revisions .............................................................................................................................................. 7 Addressing the Repository ....................................................................................................................... 8 Subversion Working Copies ..................................................................................................................... 9 Summary ..................................................................................................................................................... 14 2. Basic Usage ..................................................................................................................................................... 15 Help! .......................................................................................................................................................... 15 Getting Data into Your Repository .................................................................................................................. 16 Importing Files and Directories ............................................................................................................... 16 Recommended Repository Layout ........................................................................................................... 17 What's In a Name? ............................................................................................................................... 17 Creating a Working Copy .............................................................................................................................. 18 Basic Work Cycle ......................................................................................................................................... 19 Update Your Working Copy ................................................................................................................... 20 Make Your Changes .............................................................................................................................. 20 Review Your Changes ........................................................................................................................... 21 Fix Your Mistakes ................................................................................................................................ 25 Resolve Any Conflicts ........................................................................................................................... 26 Commit Your Changes .......................................................................................................................... 32 Examining History ........................................................................................................................................ 33 Examining the Details of Historical Changes ............................................................................................. 34 Generating a List of Historical Changes ................................................................................................... 35 Browsing the Repository ........................................................................................................................ 37 Fetching Older Repository Snapshots ....................................................................................................... 39 Sometimes You Just Need to Clean Up ............................................................................................................ 40 Disposing of a Working Copy ................................................................................................................ 40 Recovering from an Interruption ............................................................................................................. 40 Dealing with Structural Conflicts ..................................................................................................................... 41 An Example Tree Conflict ..................................................................................................................... 42 Summary ..................................................................................................................................................... 46 3. Advanced Topics .............................................................................................................................................. 47 Revision Specifiers ....................................................................................................................................... 47 iii Version Control with Subversion Revision Keywords ............................................................................................................................... 47 Revision Dates ..................................................................................................................................... 48 Peg and Operative Revisions .......................................................................................................................... 49 Properties .................................................................................................................................................... 53 Why Properties? ................................................................................................................................... 54 Manipulating Properties ......................................................................................................................... 55 Properties and the Subversion Workflow .................................................................................................. 58 Automatic Property Setting ....................................................................................................................