You are previewing Git: Distributed Version Control—Fundamentals and Workflows.
O'Reilly logo
Git: Distributed Version Control—Fundamentals and Workflows

Book Description

Git is the most popular version control system today. Here are some of the reasons why so many people are choosing Git.
- Git comes with great developer tools
- Git offers flexibility and performance
- Git allows you to work offline or in multi-site development
- Git is robust against failures and attacks
- Git has a strong open source community

This book explains the basic concepts of Git and starts with introductory chapters to get you up to speed on Git. The authors focus on agile development and provide workflows that show the necessary commands and options for solving real-world problems. The following are some of the topics discussed in this book.
- Commits and the commit history
- The repository
- Parallel development with branches
- Merging and conflict resolution
- Rebasing
- Version tagging
- Submodules and subtrees
- Troubleshooting with bisection
- Splitting a large project
- Merging small projects
- Migrating to Git

Table of Contents

  1. Introduction
    1. Why Git?
    2. A Book for Professional Developers
    3. About This Book
    4. Why Workflows?
    5. Tips for the Reader
    6. Examples and Notations
    7. Acknowledgments
    8. Standing on the Shoulders of Giants
  2. Chapter 1: Basic Concepts
    1. Distributed Version Control, How Different?
    2. The Repository, the Basis of Distributed Work
    3. Branching and Merging, Easy!
    4. Summary
  3. Chapter 2: Getting Started
    1. Setting up Git
    2. Your First Git Project
    3. Collaboration with Git
    4. Summary
  4. Chapter 3: What Is A Commit?
    1. Access Permissions and Timestamps
    2. The add and commit Commands
    3. Revisiting the Commit Hash
    4. The Commit History
    5. A Slightly Different Way of Looking at Commits
    6. Many Different Histories of the Same Project
    7. Summary
  5. Chapter 4: Multiple Commits
    1. The status Command
    2. The Staging Area Stores Snapshots
    3. What To Do with Changes That Are Not To Be Committed?
    4. Leaving out Unversioned Files with .gitignore
    5. Stashing
    6. Summary
  6. Chapter 5: The Repository
    1. A Simple and Efficient Storage System
    2. Storing Directories: Blob & Tree
    3. Identical Data Is Stored Only Once
    4. Compressing Similar Content
    5. Is It Bad When Various Files Happen to Get the Same Hash?
    6. Commits
    7. Object Reuse in the Commit History
    8. Renaming, Moving and Copying
    9. Summary
  7. Chapter 6: Branches
    1. Parallel Development
    2. Bug Fixes in An Older Version
    3. Branches
    4. Swim Lanes
    5. The Active Branch
    6. Resetting A Branch Pointer
    7. Deleting A Branch
    8. Getting Rid of the Commit Objects
    9. Summary
  8. Chapter 7: Merging Branches
    1. What Happens during A Merge?
    2. Conflicts
    3. Edit Conflicts
    4. Conflict Markers
    5. Resolving Edit Conflicts
    6. What about the Content Conflict?
    7. Fast-Forward Merges
    8. First-Parent History
    9. Tricky Merge Conflicts
    10. Regardless, Somehow It Will Work
    11. Summary
  9. Chapter 8: A Cleaner History with Rebasing
    1. The Principle: Copying of Commits
    2. Avoiding the “Diamond Chain”
    3. And When It Comes to Conflicts?
    4. Transplanting A Branch
    5. What Happens to the Original Commits after Rebasing?
    6. Why Is It Problematic to Have the Original and Copy Commits in the Same Repository?
    7. Cherry-Picking
    8. Summary
  10. Chapter 9: Exchanges between Repositories
    1. Cloning A Repository
    2. How to Tell Git Where the Other Repository Is
    3. Giving the Other Repository A Name
    4. Fetching Data
    5. Remote-Tracking Branches: Monitoring Other Repositories
    6. Working with Local Branches from Other Repositories
    7. Pull = Fetch + Merge
    8. For Diamond Haters: --rebase
    9. Push, the Opposite of Pull
    10. Naming Branches
    11. Summary
  11. Chapter 10: Version Tagging
    1. Creating A Tag
    2. Which Tags Are There?
    3. Printing the Tag Hashes
    4. Adding Tags to the Log Output
    5. In What Version Is It in?
    6. How to Change A Tag?
    7. When Do I Need A Floating Tag?
    8. Summary
  12. Chapter 11: Dependencies between Repositories
    1. Dependencies with Submodules
    2. Dependencies with Subtrees
    3. Summary
  13. Chapter 12: Tips and Tricks
    1. Don’t Panic, There Is A Reflog!
    2. Ignoring Local Changes Temporarily
    3. Examining Changes to Text Files
    4. alias - Shortcuts for Git Commands
    5. Branches as Temporary Pointers to Commits
    6. Moving Commits to Another Branch
  14. Chapter 13: Introduction to Workflows
    1. When Can I Use These Workflows?
    2. Structure of the Workflows
  15. Chapter 14: Project Setup
    1. Overview
    2. Requirements
    3. Compact Workflow: Setting Up A Project
    4. Process and Implementation
    5. Why Not the Alternatives?
  16. Chapter 15: Developing on the Same Branch
    1. Overview
    2. Requirements
    3. Workflow: Developing on the Same Branch
    4. Process and Implementation
    5. Why Not the Alternatives?
  17. Chapter 16: Developing with Feature Branches
    1. Overview
    2. Requirements
    3. Workflow “Developing with Feature Branches”
    4. Process and Implementation
    5. Why not the Alternatives?
  18. Chapter 17: Troubleshooting with Bisection
    1. Overview
    2. Requirements
    3. Workflow “Troubleshooting with bisection”
    4. Process and Implementation
    5. Why Not the Alternatives?
  19. Chapter 18: Working with A Build Server
    1. Overview
    2. Requirements
    3. Workflow “Working with A Build Server”
    4. Process and Implementation
    5. Why Not the Alternatives?
  20. Chapter 19: Performing A Release
    1. Overview
    2. Requirements
    3. Workflow “Performing A Release”
    4. Process and Implementation
    5. Why Not the Alternatives?
  21. Chapter 20: Splitting A Large Project
    1. Overview
    2. Requirements
    3. Workflow “Splitting A Large Project”
    4. Process and Implementation
    5. Why Not the Alternatives?
  22. Chapter 21: Merging Small Projects
    1. Overview
    2. Requirement
    3. Workflow “Merging Small Projects”
    4. Process and Implementation
    5. Why Not the Alternatives?
  23. Chapter 22: Outsourcing Long Histories
    1. Overview
    2. Requirements
    3. Workflow “Outsourcing Long Histories”
    4. Process and Implementation
    5. Why Not the Alternatives?
  24. Chapter 23: Using Other Version Controls in Parallel
    1. Overview
    2. Requirements
    3. Workflow “Working with Other Version Controls in Parallel”
    4. Process and Implementation
    5. Why Not the Alternatives?
  25. Chapter 24: Migrating to Git
    1. Overview
    2. Requirements
    3. Workflow “Migrating to Git”
    4. Process and Implementation
    5. Why Not the Alternatives?
  26. Chapter 25: What Else Is There?
    1. Interactive Rebasing—Making the History Better
    2. Dealing with Patches
    3. Sending Patches by Email
    4. Bundles—pull in Offline Mode
    5. Creating An Archive
    6. Graphical Tools for Git
    7. Working with Subversion
    8. Command Aliases
    9. Notes on Commits
    10. Extending Git with Hooks
  27. Chapter 26: Git’s Shortcomings
    1. High Complexity
    2. Complicated Submodules
    3. Resource Consumption for Large Binary Files
    4. Repositories Can Only Be Dealt with in Its Entirety
    5. Authorization Only on the Entire Repository
    6. Moderate Graphical Tools for History Analysis