Leanpub Header

Skip to main content

Git in the Age of AI Agents.

The Operational Playbook for Coordinating Engineers, Agents, and Subagents Without Losing Control of Your Application

This book is 100% completeLast updated on 2026-07-25

AI agents can produce code faster than teams can safely review and integrate it. This practical playbook shows how to use Git, branches, worktrees, prompts, safeguards, and recovery procedures to coordinate engineers, agents, and subagents without losing control of your application.

This book is a translation into English of Git à l’ère des agents IA which was originally written in French

Minimum price

$7.99

$9.99

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
About

About

About the Book

AI agents are changing software development. A single engineer can now coordinate several agents and subagents working simultaneously across an application. This dramatically increases production capacity—but it also multiplies branches, worktrees, uncommitted changes, conflicts, migrations, generated files, and potentially destructive Git operations.

Git in the Age of AI Agents is not another introduction to Git. It is an operational guide for teams that already use Git and now need to remain in control while humans and AI agents modify the same project.

The book explains how to define a safe working perimeter for every agent, isolate concurrent tasks with branches and worktrees, inspect repository state before any mutation, create reviewable commits, integrate parallel work, protect shared history, and recover from incidents without destroying valuable evidence.

Every important Git command is explained before the reader is asked to execute it: what it reads or changes, why it is needed, what output to expect, its level of risk, and how to stop or recover when the observed state differs from the approved state.

Each operational chapter contains:

  • a real engineering problem;
  • an emergency response;
  • a detailed procedure;
  • explained Git commands;
  • reusable prompts for AI agents;
  • common mistakes and warning signs;
  • decision points requiring human approval;
  • a final checklist;
  • a team-ready deliverable.

The book also addresses difficult situations: overlapping agent modifications, lost commits, unsafe rebases, force pushes, damaged main branches, uncontrolled worktrees, migration conflicts, secrets, generated files, production incidents, and repositories that no longer represent the expected application.

Examples inspired by the development of Tansa, a real multi-agent application, show how technically valid Git operations can still produce a functionally incorrect result—and how clear authority, preserved evidence, and disciplined recovery procedures can prevent a difficult situation from becoming a disaster.

This book is designed to be opened at the moment a problem occurs. Readers can follow the emergency section first, apply the procedure, and then study the deeper explanations when the repository is safe again.

Who This Book Is For

  • Software engineers working with AI coding agents
  • Technical leads coordinating concurrent development
  • Teams using agents and subagents on the same repository
  • Engineering managers defining safe Git policies
  • Developers responsible for recovering damaged repositories
  • Organizations introducing AI-assisted development at scale

Share this book

Categories

This book is a translation into English of Git à l’ère des agents IA which was originally written in French

Author

About the Author

Victor PEREZ

Victor Perez is an independent author whose books explore a wide variety of subjects and genres. He writes about the ideas, questions, and experiences that fascinate him—from technology, artificial intelligence, Bitcoin, and software architecture to philosophy, spirituality, human freedom, and personal transformation.

His goal is not to confine himself to a single field, but to make complex subjects clear and engaging without oversimplifying them. Whether he is documenting a real-world project, examining a philosophical question, or exploring a spiritual tradition, he approaches each book with curiosity, honesty, and a desire to invite readers to think for themselves.

Alongside his writing, he designs and develops Tansa, a Bitcoin analytics application built with Ruby on Rails, PostgreSQL, and artificial intelligence.

Translations

Translations

Languages

Contents

Table of Contents

  • Foreword
  • Part I — Understanding the New Coordination Problem
    • Chapter 1 — From Developer to Manager of a Code Production System
    • Chapter 2 — Git States and the Limits of What They Prove
  • Part II — Preparing a Multi-Agent Environment
    • Chapter 3 — Establishing an Unambiguous Starting Base
    • Chapter 4 — Isolating Missions with Worktrees and Scopes
  • Part III — Defining Contracts for Work Assigned to Agents
    • Chapter 5 — The Mission Contract
    • Chapter 6 — Commits, Tests, and the Delivery Report
  • Part IV — Coordinating Parallel Work
    • Chapter 7 — Workstream Ownership, Overlaps, and Dependencies
    • Chapter 8 — Migrations, Shared Contracts, and Generated Files
  • Part V — Review and Integrate Agent-Produced Code
    • Chapter 9 — Read a Diff as Evidence, Not Decoration
    • Chapter 10 — Refresh and Test a Mission
    • Chapter 11 — Merge Queue, Main Branch, and Publication
  • Part VI — Communicate with an AI About Git
    • Chapter 12 — Observe Before Authorizing an Intervention
    • Chapter 13 — Direct Subagents Without Losing Control
    • Chapter 14 — Supervise an Agent Fleet and Measure Its Profitability
  • Part VII — Control Dangerous Operations
    • Chapter 15 — Undo Without Confusing Reset, Restore, and Revert
    • Chapter 16 — Clean and Stash Without Erasing Unknown Work
    • Chapter 17 — Rebase and Force Push: Controlled Exceptions
    • Chapter 18 — Remove a Worktree Without Deleting Evidence
  • Part VIII — Recover After an Incident
    • Chapter 19 — The First Ten Minutes
    • Chapter 20 — Inventory States and Reconstruct the Timeline
    • Chapter 21 — Test the Recovery and Realign the Application
    • Chapter 22 — Promote the Recovery and Document the Incident
  • Part IX — Three Tansa Case Studies
    • Chapter 23 — Coordinating Three Subagents to Enable Parallelism
    • Chapter 24 — Recovering an Application That Had Become Unrecognizable
    • Chapter 25 — Turning “Certified” into Verifiable Evidence
  • Part X — Establishing the Method in the Organization
    • Chapter 26 — Daily Protocol, Dashboard, and Safeguards
    • Chapter 27 — Recovery Exercises and Team Playbook
  • Conclusion — Preserving the Ability to Decide
  • Appendices
    • Appendix A — Minimal Mission Contract
    • Appendix B — Mission Completion Report
    • Appendix C — Command Reference
    • Appendix D — Decision Matrix
    • Appendix E — Sources and Documentation
    • Appendix F — Glossary of Git, AI Agent, and Operations Terms

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub