| |
| |
Foreword | |
| |
| |
About the Author | |
| |
| |
About the Technical Reviewer | |
| |
| |
Acknowledgments | |
| |
| |
Introduction | |
| |
| |
| |
Getting Started | |
| |
| |
About Version Control | |
| |
| |
Local Version Control Systems | |
| |
| |
Centralized Version Control Systems | |
| |
| |
Distributed Version Control Systems | |
| |
| |
A Short History of Git | |
| |
| |
Git Basics | |
| |
| |
Snapshots, Not Differences | |
| |
| |
Nearly Every Operation Is Local | |
| |
| |
Git Has Integrity | |
| |
| |
Git Generally Only Adds Data | |
| |
| |
The Three States | |
| |
| |
Installing Git | |
| |
| |
Installing from Source | |
| |
| |
Installing on Linux | |
| |
| |
Installing on Mac | |
| |
| |
Installing on Windows | |
| |
| |
First-Time Git Setup | |
| |
| |
Your Identity | |
| |
| |
Your Editor | |
| |
| |
Your Diff Tool | |
| |
| |
Checking Your Settings | |
| |
| |
Getting Help | |
| |
| |
Summary | |
| |
| |
| |
Git Basics | |
| |
| |
Getting a Git Repository | |
| |
| |
Initializing a Repository in an Existing Directory | |
| |
| |
Cloning an Existing Repository | |
| |
| |
Recording Changes to the Repository | |
| |
| |
Checking the Status of Your Files | |
| |
| |
Tracking New Files | |
| |
| |
Staging Modified Files | |
| |
| |
Ignoring Files | |
| |
| |
Viewing Your Staged and Unstaged Changes | |
| |
| |
Committing Your Changes | |
| |
| |
Skipping the Staging Area | |
| |
| |
Removing Files | |
| |
| |
Moving Files | |
| |
| |
Viewing the Commit History | |
| |
| |
Limiting Log Output | |
| |
| |
Using a GUI to Visualize History | |
| |
| |
Undoing Things | |
| |
| |
Changing Your Last Commit | |
| |
| |
Unstaging a Staged File | |
| |
| |
Unmodifying a Modified File | |
| |
| |
Working with Remotes | |
| |
| |
Showing Your Remotes | |
| |
| |
Adding Remote Repositories | |
| |
| |
Fetching and Pulling from Your Remotes | |
| |
| |
Pushing to Your Remotes | |
| |
| |
Inspecting a Remote | |
| |
| |
Removing and Renaming Remotes | |
| |
| |
Tagging | |
| |
| |
Listing Your Tags | |
| |
| |
Creating Tags | |
| |
| |
Verifying Tags | |
| |
| |
Tagging Later | |
| |
| |
Sharing Tags | |
| |
| |
Tips and Tricks | |
| |
| |
Auto-Completion | |
| |
| |
Git Aliases | |
| |
| |
Summary | |
| |
| |
| |
Git Branching | |
| |
| |
What a Branch Is | |
| |
| |
Basic Branching and Merging | |
| |
| |
Basic Branching | |
| |
| |
Basic Merging | |
| |
| |
Basic Merge Conflicts | |
| |
| |
Branch Management | |
| |
| |
Branching Workflows | |
| |
| |
Long-Running Branches | |
| |
| |
Topic Branches | |
| |
| |
Remote Branches | |
| |
| |
Pushing | |
| |
| |
Tracking Branches | |
| |
| |
Deleting Remote Branches | |
| |
| |
Rebasing | |
| |
| |
The Basic Rebase | |
| |
| |
More Interesting Rebases | |
| |
| |
The Perils of Rebasing | |
| |
| |
Summary | |
| |
| |
| |
Git on the Server | |
| |
| |
The Protocols | |
| |
| |
Local Protocol | |
| |
| |
The SSH Protocol | |
| |
| |
The Git Protocol | |
| |
| |
The HTTP/S Protocol | |
| |
| |
Getting Git on a Server | |
| |
| |
Putting the Bare Repository on a Server | |
| |
| |
Small Setups | |
| |
| |
SSH Access | |
| |
| |
Generating Your SSH Public Key | |
| |
| |
Setting Up the Server | |
| |
| |
Public Access | |
| |
| |
GitWeb | |
| |
| |
Gitosis | |
| |
| |
Git Daemon | |
| |
| |
Hosted Git | |
| |
| |
GitHub | |
| |
| |
Setting Up a User Account | |
| |
| |
Creating a New Repository | |
| |
| |
Importing from Subversion | |
| |
| |
Adding Collaborators | |
| |
| |
Your Project | |
| |
| |
Forking Projects | |
| |
| |
GitHub Summary | |
| |
| |
Summary | |
| |
| |
| |
Distributed Git | |
| |
| |
Distributed Workflows | |
| |
| |
Centralized Workflow | |
| |
| |
Integration-Manager Workflow | |
| |
| |
Dictator and Lieutenants Workflow | |
| |
| |
Contributing to a Project | |
| |
| |
Commit Guidelines | |
| |
| |
Private Small Team | |
| |
| |
Private Managed Team | |
| |
| |
Public Small Project | |
| |
| |
Public Large Project | |
| |
| |
Summary | |
| |
| |
Maintaining a Project | |
| |
| |
Working in Topic Branches | |
| |
| |
Applying Patches from E-mail | |
| |
| |
Checking Out Remote Branches | |
| |
| |
Determining What Is Introduced | |
| |
| |
Integrating Contributed Work | |
| |
| |
Tagging Your Releases | |
| |
| |
Generating a Build Number | |
| |
| |
Preparing a Release | |
| |
| |
The Shortlog | |
| |
| |
Summary | |
| |
| |
| |
Git Tools | |
| |
| |
Revision Selection | |
| |
| |
Single Revisions | |
| |
| |
Commit Ranges | |
| |
| |
Interactive Staging | |
| |
| |
Stashing | |
| |
| |
Stashing Your Work | |
| |
| |
Creating a Branch from a Stash | |
| |
| |
Rewriting History | |
| |
| |
Changing the Last Commit | |
| |
| |
Changing Multiple Commit Messages | |
| |
| |
Reordering Commits | |
| |
| |
Squashing a Commit | |
| |
| |
Splitting a Commit | |
| |
| |
The Nuclear Option: filter-branch | |
| |
| |
Debugging with Git | |
| |
| |
File Annotation | |
| |
| |
Binary Search | |
| |
| |
Submodules | |
| |
| |
Starting with Submodules | |
| |
| |
Cloning a Project with Submodules | |
| |
| |
Superprojects | |
| |
| |
Issues with Submodules | |
| |
| |
Subtree Merging | |
| |
| |
Summary | |
| |
| |
| |
Customizing Git | |
| |
| |
Git Configuration | |
| |
| |
Basic Client Configuration | |
| |
| |
Colors in Git | |
| |
| |
External Merge and Diff Tools | |
| |
| |
Formatting and Whitespace | |
| |
| |
Server Configuration | |
| |
| |
Git Attributes | |
| |
| |
Binary Files | |
| |
| |
Keyword Expansion | |
| |
| |
Exporting Your Repository | |
| |
| |
Merge Strategies | |
| |
| |
Git Hooks | |
| |
| |
Installing a Hook | |
| |
| |
Client-Side Hooks | |
| |
| |
Server-Side Hooks | |
| |
| |
An Example Git-Enforced Policy | |
| |
| |
Server-Side Hook | |
| |
| |
Client-Side Hooks | |
| |
| |
Summary | |
| |
| |
| |
Git and Other Systems | |
| |
| |
Git and Subversion | |
| |
| |
git svn | |
| |
| |
Setting Up | |
| |
| |
Getting Started | |
| |
| |
Committing Back to Subversion | |
| |
| |
Pulling in New Changes | |
| |
| |
Git Branching Issues | |
| |
| |
Subversion Branching | |
| |
| |
Subversion Commands | |
| |
| |
Git-Svn Summary | |
| |
| |
Migrating to Git | |
| |
| |
Importing | |
| |
| |
Perforce | |
| |
| |
A Custom Importer | |
| |
| |
Summary | |
| |
| |
| |
Git Internals | |
| |
| |
Plumbing and Porcelain | |
| |
| |
Git Objects | |
| |
| |
Tree Objects | |
| |
| |
Commit Objects | |
| |
| |
Object Storage | |
| |
| |
Git References | |
| |
| |
The HEAD | |
| |
| |
Tags | |
| |
| |
Remotes | |
| |
| |
Packfiles | |
| |
| |
The Refspec | |
| |
| |
Pushing Refspecs | |
| |
| |
Deleting References | |
| |
| |
Transfer Protocols | |
| |
| |
The Dumb Protocol | |
| |
| |
The Smart Protocol | |
| |
| |
Downloading Data | |
| |
| |
Maintenance and Data Recovery | |
| |
| |
Maintenance | |
| |
| |
Data Recovery | |
| |
| |
Removing Objects | |
| |
| |
Summary | |
| |
| |
Appendix Creative Commons Legal Code | |
| |
| |
Index | |