Table of Contents
Acknowledgments xi
Introduction xiii
Who Is This Book For? xiii
How to Read This Book xiv
How Git Is Different xvi
The Git Workflow xvii
Online Resources xx
I Getting Started 1
Task 1 Installing Git 4
Task 2 Configuring Git 6
Task 3 Creating a New Repository 8
Task 4 Creating a Local Copy of an Existing Repository 10
II Working with Git 13
Task 5 Seeing What Has Changed 18
Task 6 Staging Changes to Commit 20
Task 7 Committing Changes 22
Task 8 Ignoring Files 24
Task 9 Undoing Uncommitted Changes 26
Task 10 Moving Files in Git 28
Task 11 Deleting Files in Git 30
Task 12 Sharing Changes 32
III Organizing Your Repository with Branches and Tags 35
Task 13 Creating and Switching Branches 42
Task 14 Viewing Branches 44
Task 15 Merging Commits Between Branches 46
Task 16 Rewriting History by Rebasing 48
Task 17 Deleting Branches 50
Task 18 Tagging Milestones 52
IV Working with a Team 55
Task 19 Adding and Removing Remotes 60
Task 20 Retrieving Remote Changes 62
Task 21 Retrieving Remote Changes, Part II 64
Task 22 Sending Changes to Remotes 66
Task 23 Handling Remote Tags and Branches 68
V Branches and Merging Revisited 71
Task 24 Handling Conflicts 74
Task 25 Handling Conflicts with a GUI 76
Task 26 Temporarily Hiding Changes 78
Task 27 Cherry-Picking Commits 80
Task 28 Controlling How You Replay Commits 82
Task 29 Moving Branches 84
VI Working with the Repository's History 87
Task 30 Viewing the Log 92
Task 31 Filtering the Log Output 94
Task 32 Comparing Differences 96
Task 33 Generating Statistics About Changes 98
Task 34 Assigning Blame 100
VII Fixing Things 103
Task 35 Fixing Commits 106
Task 36 Reverting Commits 108
Task 37 Resetting Staged Changes and Commits 110
Task 38 Erasing Commits 112
Task 39 Finding Bugs with bisect 114
Task 40 Retrieving "Lost" Commits 116
VIII Moving Beyond the Basics 119
Task 41 Exporting Your Repository 122
Task 42 Doing Some Git Housekeeping 124
Task 43 Syncing with Subversion 126
Task 44 Initializing Bare Repositories 128
A Glossary 131
Index 135