Download Git Magic - Stanford University
Transcript
Table of Contents Preface .......................................................................................... vii 1. Introduction ................................................................................. 1 1.1. Version control ................................................................ 1 1.2. Distributed version control .............................................. 2 1.3. Distribution is not anarchy .............................................. 3 1.4. Merge conflicts ................................................................ 4 2. Basics .......................................................................................... 5 2.1. Saving state ...................................................................... 5 2.2. Add, delete, rename ......................................................... 5 2.3. Advanced undo/redo ........................................................ 6 2.4. Reverting .......................................................................... 7 2.5. Changelog generation ...................................................... 8 2.6. Downloading a project .................................................... 8 2.7. The bleeding edge ........................................................... 8 2.8. Instant publishing ............................................................ 8 2.9. What have I done? ........................................................... 9 2.10. Exercise ........................................................................ 10 3. Clones ....................................................................................... 11 3.1. Staying in sync .............................................................. 11 3.2. Classic source control .................................................... 11 3.3. Bare repositories ............................................................ 13 3.4. Push versus pull ............................................................. 13 3.5. Forking a project ........................................................... 13 3.6. Ultimate backups ........................................................... 14 3.7. Multitasking ................................................................... 14 3.8. Guerilla version control ................................................. 15 3.9. Mercurial ........................................................................ 15 3.10. Bazaar .......................................................................... 16 3.11. Why I use Git .............................................................. 17 4. Branches ................................................................................... 18 4.1. My first branch .............................................................. 18 4.2. Dirty work ..................................................................... 19 4.3. Quick fixes ..................................................................... 20 4.4. Merging .......................................................................... 21 4.5. Uninterrupted workflow ................................................. 22 iii