This pocket guide is the perfect on-the-job companion to Git, the distributed version control system. It provides a compact, readable introduction to Git for new users, as well as a reference to common commands and procedures for those of you with Git experience. Written for Git version 1.8.2, this handy task-oriented guide is organized around the basic version control functions you need, such as making commits, fixing mistakes, merging, and searching history. Examine the state of your project at earlier points in time Learn the basics of creating and making changes to a repository Create branches so many people can work on a project simultaneously Merge branches and reconcile the changes among them Clone an existing repository and share changes with push/pull commands Examine and change your repositoryâ??s commit history Access remote repositories, using different network protocols Get recipes for accomplishing a variety of common tasks Cover Copyright Table of Contents Preface What Is Git? Goals of This Book Conventions Used in This Book Unix Shell Command Syntax Typography Using Code Examples Safari® Books Online How to Contact Us Acknowledgments Chapter 1. Understanding Git Overview Terminology Branches Sharing Work The Object Store Blob Tree Commit Tag Object IDs and SHA-1 Security Where Objects Live The Commit Graph Refs Related Commands Branches The Index Merging Merging Content Merging History Push and Pull Notes Chapter 2. Getting Started Basic Configuration Personal Identification Text Editor Commit ID Abbreviation Pagination Color Cryptographic Keys Command Aliases Getting Help References Creating a New, Empty Repository Selected Options Importing an Existing Project Ignoring Files Syntax of “Ignore Patterns” Chapter 3. Making Commits Changing the Index Adding a New File Adding the Changes to an Existing File Adding Partial Changes Shortcuts Removing a File Renaming a File Unstaging Changes Making a Commit Commit Messages What Makes a Good Commit? Shortcuts Empty Directories A Commit Workflow Chapter 4. Undoing and Editing Commits Changing the Last Commit Double Oops! Discarding the Last Commit Discarding Any Number of Commits Undoing a Commit Partial Undo Editing a Series of Commits Conflicts The exec Action Chapter 5. Branching The Default Branch, master Making a New Branch Switching Branches Uncommitted Changes Untracked Files Losing Your Head Deleting a Branch Renaming a Branch Chapter 6. Tracking Other Repositories Cloning a Repository Clones and Hard Links Bare Repositories Reference Repositories Local, Remote, and Tracking Branches Synchronization: Push and Pull Pulling Pushing Push Defaults Pull with Rebase Notes Access Control Chapter 7. Merging Merge Conflicts Resolving Merge Conflicts Notes Details on Merging Merge Tools Notes Custom Merge Tools Merge Strategies Why the Octopus? Reusing Previous Merge Decisions Chapter 8. Naming Commits Naming Individual Commits Commit ID Ref Name Names Relative to a Given Commit Names Relative to the Reflog The Upstream Branch Matching a Commit Message Following Chains Addressing Pathnames Naming Sets of Commits Chapter 9. Viewing History Command Format Output Formats Defining Your Own Formats Notes Limiting Commits to Be Shown Regular Expressions Reflog Decoration Date Style Listing Changed Files Showing and Following Renames or Copies Detecting Copies Rewriting Names and Addresses: The “mailmap” Shortening Names Searching for Changes: The “pickaxe” Showing Diffs Color Word Diff Comparing Branches Displaying Sides Showing Notes Commit Ordering History Simplification Related Commands git cherry git shortlog Chapter 10. Editing History Rebasing Undoing a Rebase Importing from One Repository to Another Importing Disconnected History Importing Linear History Importing Nonlinear History Commit Surgery: git replace Keeping It Real The Big Hammer: git filter-branch Examples Notes Chapter 11. Understanding Patches Applying Plain Diffs Patches with Commit Information Chapter 12. Remote Access SSH HTTP Storing Your Username Storing Your Password References Chapter 13. Miscellaneous git cherry-pick git notes git notes Subcommands git grep Combining Regular Expressions What to Search What to Show How to Match git rev-parse git clean git stash Subcommands git show git tag Deleting a Tag from a Remote Following Tags Backdating Tags git diff git diff git diff --staged git diff git diff Options and Arguments git instaweb Git Hooks Visual Tools Submodules Chapter 14. How Do I...? ...Make and Use a Central Repository? ...Fix the Last Commit I Made? ...Edit the Previous n Commits? ...Undo My Last n Commits? ...Reuse the Message from an Existing Commit? ...Reapply an Existing Commit from Another Branch? ...List Files with Conflicts when Merging? ...Get a Summary of My Branches? ...Get a Summary of My Working Tree and Index State? ...Stage All the Current Changes to My Working Files? ...Show the Changes to My Working Files? ...Save and Restore My Working Tree and Index Changes? ...Add a Downstream Branch Without Checking It Out? ...List the Files in a Specific Commit? ...Show the Changes Made by a Commit? ...Get Tab Completion of Branch Names, Tags, and So On? ...List All Remotes? ...Change the URL for a Remote? ...Remove Old Remote-Tracking Branches? ...Have git log: Find Commits I Made but Lost? Not Show the diffs for Root Commits? Show the Changes for Each Commit? Show the Committer as well as the Author? Index La 4e de couverture porte: "This pocket guide is the perfect on-the-job companion to Git, the distributed version control system. It provides a compact, readable introduction to Git for new users, as well as a reference to common commands and procedures for those of you with Git experience. Written for Git version 1.8.2, this handy task-oriented guide is organized around the basic version control functions you need, such as making commits, fixing mistakes, merging, and searching history. Examine the state of your project at earlier points in time, learn the basics of creating and making changes to a repository, create branches so many people can work on a project simultaneously, merge branches and reconcile the changes among them, clone an existing repository and share changes with push/pull commands, examine and change your repository's commit history, access remote repositories, using different network protocols, get recipes for accomplishing a variety of common tasks." This pocket guide is the perfect on-the-job companion to Git, the distributed version control system. It provides a compact, readable introduction to Git for new users, as well as a reference to common commands and procedures for those of you with Git experience. Written for Git version 1.8.2, this handy task-oriented guide is organized around the basic version control functions you need, such as making commits, fixing mistakes, merging, and searching history. * Examine the state of your project at earlier points in time * Learn the basics of creating and making changes to a repository * Create branches so many people can work on a project simultaneously * Merge branches and reconcile the changes among them * Clone an existing repository and share changes with push/pull commands * Examine and change your repository’s commit history * Access remote repositories, using different network protocols * Get recipes for accomplishing a variety of common tasks This pocket guide is the perfect on-the-job companion to Git, the distributed version control system. It provides a compact, readable introduction to Git for new users, as well as a reference to common commands and procedures for those of you with Git experience.Written for Git version 1.8.2, this handy task-oriented guide is organized around the basic version control functions you need, such as making commits, fixing mistakes, merging, and searching history.Examine the state of your project at earlier points in timeLearn the basics of creating and making changes to a repositoryCreate branches so many people can work on a project simultaneouslyMerge branches and reconcile the changes among themClone an existing repository and share changes with push/pull commandsExamine and change your repository’s commit historyAccess remote repositories, using different network protocolsGet recipes for accomplishing a variety of common tasks