The Book: Git for Teams

You can do more with Git than just build software. This practical guide delivers a unique people-first approach to version control that also explains how using Git as a focal point can help your team work better together. You’ll learn how to plan and pursue a Git workflow that not only ensures that you accomplish project goals, but also fits the immediate needs and future growth of your team.

The first part of the book on structuring workflow is useful for project managers, technical team leads, and CTOs. The second part provides hands-on exercises to help developers gain a better understanding of Git commands.

  • Explore the dynamics of team building
  • Walk through the process of creating and deploying software with Git
  • Structure workflow to influence the way your team collaborates
  • Learn a useful process for conducting code reviews
  • Set up a shared repository and identify specific team members as contributors, consumers, or maintainers
  • Know the why behind the Git commands your teammates use
  • Use branching strategies to separate different approaches to your project
  • Examine popular collaboration platforms: GitHub, Bitbucket, and GitLab

Supplemental Materials

Ordering Copies

Git for Teams is now available from O'Reilly, Amazon (US, Canada, UK), and better bookstores around the world.

Table of Contents

Extended chapter outline.

Part 1. Defining Your WorkFlow

The theory of how you'll be working, but not the actual commands...yet.

Chapter 1. Working in Teams

  • The People on Your Team
  • Thinking Strategies
  • Meeting as a Team

Chapter 2. Project Governance

  • Basic Concepts
  • Centralized vs. Decentralized Development
  • Contributors with Dispersed Repositories
  • Contributors with Collocated Repositories
  • Contributors with Shared Maintenance

Chapter 3. Branching Strategies

  • Choosing and Using Conventions
  • Constant Integration
  • Branch-per-Feature Deployment
  • Scheduled Deployment
  • Updating Branches

Chapter 4. Work Flows that Work

  • Evolving Work Flows
  • Ticket Progression
  • A Basic Team Work Flow
  • Releasing Software According to Schedule
  • Collaborating on Non-Software Projects 52

Part 2. Applying the Commands to Your Workflow

The basic commands you will need to work effectively with your team.

Chapter 5. Teams of One

  • Issue-Based Version Control
  • Creating Local Repositories
  • Working with Branches
  • Adding Changes to a Repository
  • Working with Tags
  • Connecting to Remote Repositories

Chapter 6. Rollbacks, Resets, Reverts, and Rebasing

  • Best Practices
  • Rebasing Step-by-Step
  • An Overview of Locating Lost Work
  • Restoring Files
  • Working with Commits
  • Undoing Shared History
  • Really Removing History

Chapter 7. Teams of More than One

  • Setting Up the Project
  • Setting Up the Developers
  • Participating in Development
  • Sample Workflows

Chapter 8. Ready for Review

  • Types of Reviews
  • Types of Reviewers
  • Establishing the Problem
  • Review the Proposed Changes
  • Apply the Proposed Changes
  • Prepare Your Feedback
  • Submit Your Evaluation
  • Complete the Review

Chapter 9. Finding and Fixing Bugs

  • Using Stash to Work on an Emergency Bug Fix
  • Comparative Studies of Historical Records
  • File Ancestry with Blame
  • Historical Reenactment with Bisect

Part 3. Git Hosting

Where to put your files for collaboration and backups of your local work.

Chapter 10. Open Source Projects on GitHub

  • Getting Started on GitHub
  • Using Public Projects on GitHub
  • Contributing to Projects
  • Running Your Own Project

Chapter 11. Private Team Work on BitBucket

  • Using BitBucket for private projects
  • Creating projects
  • Collaborating on BitBucket (private, branching strategy)

Chapter 12. Self-Hosted Collaboration with GitLab

  • Using Git without a ticketing system
  • Using GitLab
    • Hosted vs. self-hosted
    • Can have the tool inside your firewall without paying enterprise pricing (GitHub's Enterprise; Atlassian's Stash); however, there are more features if you get the subscription to Enterprise


All of the etc. chapters.

Appendix A. Installing Git

  • Check to see which version you have installed.
  • Upgrading (OSX, Windows, Linux)
  • Installing (OSX, Windows, Linux)

Appendix B. Configuring Git

  • Identifying Yourself
  • Adding Colour
  • Useful Aliases
  • Sample Configuration File

Appendix C. Demystifying Detached HEADs

A brief analogy which (hopefully) helps to explain what a detached HEAD state is.