Pragmatic Guide to Subversion
Total Page:16
File Type:pdf, Size:1020Kb
Download from Wow! eBook <www.wowebook.com> What Readers Are Saying About Pragmatic Guide to Subversion Mike has been around the block with Subversion and knows the toolset intimately. Just as importantly, he’s seen firsthand how it’s used on real projects. Those two aspects come together in this book with the fundamen- tals of source control with Subversion, guided by real-world, pragmatic (of course!) experience. As a Subversion user and occasional noob, this is the book I want to guide me day to day and dig me out of those irksome holes. Jim W e b b e r Author, REST in Practice I really like the organization of the book. I found Pragmatic Guide to Sub- version to be v e r y easy to read, and it really gets the information across in an engaging way. This book is clear, concise, and comprehensive. It’s an indispensable reference for anyone working with Subversion. Ian Bourke Independent software developer, UK A good digest of Subversion’s capabilities. The author’s writing style is terse yet conversational, and the book progressed nicely from basic topics to those more advanced. Overall, I think the book is an e x c e l l e n t follow-up to Pragmatic V e r s i o n Control Using Subversion. Graham Nash Retlang, Message-based concurrency in .NET This is a book worth having since the “full” Pragmatic Subversion book is too big for e v e r y developer on a team to read. I was a fan of Mike’s original Subversion book, and he’s carried on the style into this pocket reference. This is a book I recommend. Mike Roberts Senior software engineer, DRW T r a d i n g Group Pragmatic Guide to Subversion has e v e r y t h i n g I needed to get up and run- ning with SVN on my Mac. Being new to Mac OS X, it was a welcome sur- prise to have e x a m p l e s in multiple operating systems. Michael Raczynski Software architect, Canada Download from Wow! eBook <www.wowebook.com> Pragmatic Guide to Subversion Mike Mason The Pragmatic Bookshelf Raleigh, North Carolina Dallas, T e x a s Download from Wow! eBook <www.wowebook.com> Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Pro- grammers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC. Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein. Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://www.pragprog.com. The team that produced this book includes: Editor: Jackie Carter Indexing: Potomac Indexing, LLC Copy edit: Kim W i m p s e t t Layout: Steve Peter Production: Janet Furlow Customer support: Ellie Callahan International: Juliet Benda Copyright © 2010 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. Printed in the United States of America. ISBN-10: 1-934356-61-1 ISBN-13: 978-1-934356-61-6 Printed on acid-free paper. P1.0 printing, October 2010 V e r s i o n : 2010-11-12 Download from Wow! eBook <www.wowebook.com> Contents Acknowledgments 8 Introduction 9 Who Is This Book F o r ? . 10 How to Read This Book . 11 Subversion V e r s i o n s . 12 Online Resources . 12 I Getting Started 13 T a s k 1. Installing a Command-Line Client 16 T a s k 2. Installing a Graphical Client on W i n d o w s 18 T a s k 3. Installing a Graphical Client on Mac OS X 20 T a s k 4. Creating a Local Repository 22 T a s k 5. Creating an Empty Project 24 T a s k 6. Creating a Project from an Existing Source T r e e 26 II W o r k i n g with Subversion 28 T a s k 7. Checking Out a W o r k i n g Copy 32 T a s k 8. Seeing What Y o u ’ v e Changed 34 T a s k 9. Seeing What Y o u ’ v e Changed Using T o r t o i s e 36 T a s k 10. Seeing What Y o u ’ v e Changed Using Cornerstone 38 T a s k 11. Committing Changes 40 T a s k 12. Adding Files and Directories 42 Download from Wow! eBook <www.wowebook.com> CONTENTS 6 T a s k 13. Removing Files and Directories 44 T a s k 14. Moving and Renaming Files and Directories 46 T a s k 15. Reverting W o r k i n g Copy Changes 48 T a s k 16. Ignoring Files 50 III W o r k i n g with a T e a m 52 T a s k 17. Updating to the Latest Revision 56 T a s k 18. Handling Conflicts 58 T a s k 19. Handling Conflicts Using T o r t o i s e 60 T a s k 20. Handling Conflicts Using Cornerstone 62 IV Using the History 64 T a s k 21. V i e w i n g the Log 66 T a s k 22. Detective W o r k with svn blame 68 T a s k 23. Reverting a Committed Revision 70 V Branching, Merging, and T a g g i n g 72 T a s k 24. Creating a Branch 78 T a s k 25. Switching to a Branch 80 T a s k 26. Merging Changes from T r u n k to Branch 82 T a s k 27. Using Change T r a c k i n g 84 T a s k 28. T a g g i n g a Release 86 VI File Locking 88 T a s k 29. Enabling File Locking 92 T a s k 30. Obtaining a Lock 94 T a s k 31. Releasing a Lock 96 T a s k 32. Breaking Someone Else’s Lock 98 Report erratum Download from Wow! eBook <www.wowebook.com> this copy is (P1.0 printing, October 2010) CONTENTS 7 VII Setting Up a Server 100 T a s k 33. Installing Subversion Server 104 T a s k 34. Creating a Repository 106 T a s k 35. Installing Subversion Server on W i n d o w s 108 T a s k 36. Using Third-Party Subversion Hosting 110 T a s k 37. Migrating a CVS Repository 112 T a s k 38. Backing Up and Restoring 114 T a s k 39. P e r f o r m i n g Full W e e k l y Backups 116 T a s k 40. P e r f o r m i n g Incremental Daily Backups 118 T a s k 41. Securing a Repository 120 T a s k 42. Using Repository Hooks 122 VIII Advanced T o p i c s 124 T a s k 43. W o r k i n g with Properties 126 T a s k 44. Using Externals 128 T a s k 45. Organizing Multiple Projects 130 T a s k 46. Storing Third-Party Code 132 T a s k 47. W o r k i n g Directly with the Repository 134 T a s k 48. Using Patch Files 136 A Bibliography 138 Index 139 Report erratum Download from Wow! eBook <www.wowebook.com> this copy is (P1.0 printing, October 2010) Acknowledgments Every book—even a shorter one like this Pragmatic Guide—represents an incredible amount of work by a large group of people. As an author, my con- tribution is only a fraction of the effort that’s required to get a book into the hands of readers, and I’d like to thank e v e r y o n e else involved. First and foremost, I’d like to thank my family for supporting me while writ- ing another book. I’m a new dad with a young son at home, and despite my best efforts to write faster, our daughter arrived too before I finished the book. So, to my wife, Michelle, and her mom, P a t , thanks for taking care of the kids and letting me have those Sundays in the office writing the book. T o Ben and Natalie, thanks for not being too upset when “Daddy working!” I promise to always come home. Next, the Pragmatic Guide series idea came from T r a v i s Swicegood, author of the e x c e l l e n t Pragmatic V e r s i o n Control Using Git [Swi08].