Git and Version Control
From repositories, commits and branches to merging, pull requests, the commit graph, recovery, work with coding agents and deployment from a repository, Git and version control as told through the free samples of the Leanpub books about them.
Created from the free samples of 9 Leanpub books and the descriptions and tables of contents of 18 more books and courses, with every source cited.
Version control is the keeping of a history of changes to a set of files, so that any earlier version can be recalled and the work of several people can be combined; one introductory course here defines it as a system that records changes to a file or set of files over time so that specific versions can be recalled later.[7] Git, released in 2005, is the system that almost all software is now kept in. It is distributed: every copy of a repository is a complete repository with the whole history, and none is technically the master of the others.[1]
Git is also notoriously easy to use without understanding. One author meets very able people every day who use only three commands, and meets them because something has happened and they do not know where to turn; the same author thinks the software community badly served by the available material, which is either impenetrable or a recipe for one problem.[1] Most of the books on this shelf are attempts to do better, by brevity, by exercises, by stories or by explaining the few abstractions on which everything rests.[2][6][12][3]
This article covers where to begin, the history, what version control is for, how Git works, learning the commands, collaboration, recovery and advanced use, coding agents and newer tools, and Git in the wider workflow. Its sources are the free samples of the Leanpub books listed at the end, with the descriptions and tables of contents of the books and courses whose samples were not available, and every claim that rests on a source is cited to it.
Where to start
A reader who has never used the command line should start there: The Unix Workbench (2017), the most widely sold book in the extract, teaches it to people with no programming experience, from moving among files through pipes and shell programming to Git, a hosting service and a server in the cloud, and exists also as the course The Unix Workbench.[19][20]
For Git itself the beginner's books differ mainly in method. Painless Git (2020) is short, friendly and opinionated,[2] Git Workbook (2018) is a workbook in which each section teaches one skill and sets an assignment,[6] Essential Git (2024) is a course in the parts used daily in any company,[7] Beginning Git Version Control (2021) trims the commands to the essentials and gives reasons,[4] Simply Git (2020) works one example through,[11] and Git, The Magic Notebook Understanding Version Control Through Stories tells a story of four friends.[12] Git: in easy steps (2017) does everyday tasks through a graphical client instead.[14]
Those who mean to contribute to shared projects should read Collaborative Development using Git and GitHub (2019), built round the tasks of contribution.[5] Developers who already get by and want to understand have Learn Git The Hard Way (2022), a course in four parts,[1] and GIT intermediate (2023) on the mechanics;[3] and teams running several coding agents on one repository have Git in the Age of AI Agents..[8]
History
The first version control tools, in the 1970s and 1980s, kept the history of single files on one machine. Their successors from the late 1980s kept a whole project on a central server, from which developers checked out working copies and to which they committed. In 2005 the developers of the Linux kernel, needing a replacement for the distributed tool they had been using, wrote Git in a few weeks, and the same year saw another distributed system released. Hosting services built on Git appeared from 2008 and added the pull request, a way of proposing and reviewing a change, and within a decade Git had displaced nearly everything else.
The books remember the stages. The author of Learn Git The Hard Way is old enough, the book says, to recall people complaining about having to use source control at all, and describes the centralised tools in which a checked-out copy was inferior in status to the server's and code was either changed locally or committed, committed meaning sent to the server. Git was created so that people could work on the kernel across the globe and offline, and so has no concept of a central server holding the authoritative source.[1] The author of Beginning Git Version Control used a centralised system in a team making games before moving the team to Git in 2009.[4] Collaborative Development using Git and GitHub cites a survey of 2017 in which seven developers in ten used Git, nearly one in twenty used no version control at all, and a few more kept versions by hand.[5] Practical Git and GitHub (2016) is a compilation of posts written from 2012 to 2014, when the practices were being settled.[10] And Juju-chu! — Starting Your Jujutsu × AI Workflow with `jj new`, on a newer system, says that engineers who entered the industry after 2010 have mostly never used anything but Git, that the largest hosting service was the biggest single force in making it the standard, and that it is so rare for a new system to gain attention that it feels like an event when one does.[9]
What version control is for
Learn Git The Hard Way begins with the problem. Colleagues who must keep track of changes to shared code can send each other files, or email when something changes, or keep numbered archives in one place, and each method fails as a project grows: more developers mean more communication, several lines of work on one code base become hard to follow, and people changing the same files at the same time must be co-ordinated. A source control tool manages that complexity. It is, the book says, a database of files and of the histories of their states, and like any database it demands some skill before it repays it.[1]
Painless Git adds the case of the developer working alone. Anyone who has made a change that seemed brilliant in the small hours and proved terrible the next morning knows the use of being able to go back, and a history kept diligently is, in the book's phrase, a safety net.[2] Essential Git lists the advantages in the same spirit, beginning with the plainest: every change saves a new version and keeps the old, so that a mistake can be undone, and the changes are also sent to another machine.[7] Collaborative Development using Git and GitHub extends the audience further, to people who are not programmers and are asked to correct documentation or adjust a configuration file kept in a repository.[5]
How Git works
The first thing to grasp, Learn Git The Hard Way insists, is that Git is distributed. A repository is not a link to a server or a shadow of another repository; each is a full copy of the one it was copied from, and may refer to its origin or not. The book puts it as a slogan, that all repositories are born equal. The second is that content passes through four phases on its way into the history, and the author attributes most confusion about Git to not having understood them. The third is the branch, a line of commits, drawn in diagrams with arrows that by convention point backwards in time.[1] Git Workbook makes the same point in its first exercise: local work is done on a real repository, and the remotes with which it exchanges changes are repositories in exactly the same way.[6]
GIT intermediate reduces the system to a few abstractions. A repository is a directed graph of commits without cycles. A commit never changes; what change are refs, names that point to commits as pointers do in programming, of which there are two kinds, those that hold the identity of a commit and those that hold the name of another ref. A branch is a ref, and the commit it points to at a given moment is its tip. The most important ref is the one that records where work is at present: usually it points to a branch, and when a commit is made, the commit it indicates becomes the parent of the new one and the branch moves forward to the new commit. When it points directly to a commit and not to a branch, the repository is in the state that alarms so many users, which the book treats as merely unusual. To show how little there is, the author builds a repository by hand, two empty directories and a one-line file, and the tools accept it. The book is addressed to anyone who affects how code is managed and recommends returning to these roots after months or years of use.[3]
Learning the commands
The introductory books agree that a small part of Git does most of the work. Beginning Git Version Control starts with installing, creating a repository, committing changes as snapshots, writing helpful messages and reading the status and the log. Its author, who has tried different ways of working in teams making games, books, mobile applications and websites, prefers the command line, as faster, and notes that graphical clients embody the same concepts with buttons for the commands; the first configuration is a name and an email address, so that it can later be traced who changed what.[4] Painless Git states its aims as a list, to be short, cheap, easy to understand, friendly, opinionated and light in tone without being unserious, and says what it is not: a reference, or an explanation of the internals. It is arranged in three parts, called beginning, refinement and sophistication, and where an opinion is only an opinion the author undertakes to give the other side. Its promise is to get a reader over the first hurdles, to the point where more advanced material begins to make sense.[2]
Git Workbook explains, shows and then asks the reader to try, with puzzles and quizzes meant to fix things in the memory and a box to tick for each section.[6] Essential Git goes from the life cycle of a file's status through branching and remote repositories to the workflows in use, and ends with its students working together on one open project.[7] Simply Git teaches the commands that cover most daily needs through one worked example,[11] Introduction to Git and GitHub (2023) has a short chapter for each command,[15] Everyday Git 2022 - Attaining code quality and keeping your team sane is a very short book of tips,[17] and Git for Beginners takes one project from its first commit to a pull request, with attention to what to do when something goes wrong.[18] Git, The Magic Notebook Understanding Version Control Through Stories introduces each feature as the answer to a problem its characters meet, so that, as its description says, Git stops being magic and becomes logic.[12]
Collaboration
Collaborative Development using Git and GitHub is organised by the tasks of contributing to a project that belongs to someone else. The first pull request is a change made entirely in the browser, without copying the repository, with an automated build to catch mistakes; this suits a corrected word or a few lines of documentation. The second uses the contributor's own computer and editor. Then come the questions that arise once a project is live: how to catch up when others have contributed in the meantime, how to bring an unfinished change up to the current state of the project so as to spare its maintainers work, and how to deal with the two kinds of conflict that occur when people change the same things.[5] Git Prodigy (2023) follows the basics with forking, pull requests and the other mechanisms of the largest hosting service,[16] and Practical Git and GitHub records the problems one developer actually met in daily use while building and releasing one product: branches for the fixing of faults, tags, forks, the rewriting of history and deployment by pushing to a repository, in the order in which the posts were written.[10]
Recovery and advanced use
Learn Git The Hard Way is for readers who have been confused by why a merge failed, why a push was refused, what a fast-forward is or what it means to rebase, and takes them in four parts to the fundamentals needed to look after a repository; its method is to make the reader type everything and understand each step, so that the official documentation becomes readable. Beyond branching it reaches the shelving of unfinished work, the log of past positions, rebasing, the search for a faulty commit by bisection, several working directories on one repository, repositories nested in others, and scripts that run on events.[1] Git, The Magic Notebook (Advanced) is a short second volume for developers who can commit, push and merge and who panic when something goes wrong: recovering a deleted commit from the log of where references have been, finding the commit that introduced a fault, and tidying a history before proposing it.[13]
Coding agents and newer tools
Two books of 2026 respond to software agents that write code. Git in the Age of AI Agents. observes that agents now produce code faster than a team can understand, review and integrate it, and that this does not make Git obsolete but exposes what it was never designed to decide: who owns a task, which changes are authorised, in what order work is combined and when it must stop. The book, for experienced developers and those who lead them, teaches no basic commands. It builds a system of control round the repository, an identifiable base, an isolated space for each agent, an explicit scope, reproducible evidence, ordered integration and human accountability, and grades operations by risk, from observation through local changes that can be undone to changes to shared history. Git preserves objects and references, it says; the organisation must preserve the intent, authority and evidence that give them meaning, and a commit can show what changed but not what the agent was asked. Its worked examples, taken from the history of a real application, accordingly distinguish what is observed in the repository, what was recorded at the time and what has been reconstructed afterwards.[8]
Juju-chu! — Starting Your Jujutsu × AI Workflow with `jj new` is a guide to a newer version control system that works with Git repositories. Its development began in 2019, the first public release came in 2022, and it was being discussed widely by 2025, which the preface connects with the spread of agents: traditional tools assume that people write code carefully, decide consciously what to record and share it when everything is ready, and that premise fits badly when code is cheap to produce and to redo. To the usual objection that the same things can be done in Git, the preface answers that being able to do something and being able to do it comfortably are different, and compares two generations of telephone. The body of the book is arranged as questions that users of Git ask, such as why there is no command to pull, and as remedies for the surprises they meet.[9]
Git in the wider workflow
Several adjacent books show where a repository leads. In the practice called GitOps the desired state of a running system is described in a repository, and automation makes the system match it. GitOps (2021), a short and widely sold introduction, presents this as continuous deployment through tools that developers already know,[21] and Master GitOps with Argo CD (2025) is a practical guide to one tool for it.[22] GitHub Actions A Complete Visual Guide introduces, largely in diagrams, the automation that a hosting service can run on each change,[23] and Team Guide to Software Releasability (2021) argues that every piece of a delivery pipeline should itself be under version control, so that a production system can be rebuilt from nothing.[24] DevOps Katas (2018) offers short repeated exercises in Git among other tools.[25]
Data analysts have their own versions of the argument. Production Ready Data Science (2025) makes version control its first chapter, on what it is, why it is essential and how to use Git well,[26] and Building reproducible analytical pipelines with R (2023) includes Git among the tools that make an analysis reproducible from the start.[27]
Questions about Git and Version Control
Which Git book should I start with?
For Git itself the beginner's books differ mainly in method: Painless Git (2020) is short, friendly and opinionated, Git Workbook (2018) is a workbook in which each section teaches one skill and sets an assignment, and Essential Git (2024) is a course in the parts used daily in any company.[2][6][7] A reader who has never used the command line should start with The Unix Workbench (2017), which teaches it to people with no programming experience and goes on to Git.[19] Developers who already get by and want to understand have Learn Git The Hard Way (2022), a course in four parts.[1]
What is version control and why use it?
Essential Git defines version control as a system that records changes to a file or set of files over time so that specific versions can be recalled later.[7] For a team, a source control tool manages the complexity of several people changing the same code, which sending each other files or keeping numbered archives fails to do as a project grows.[1] For the developer working alone, Painless Git calls a history kept diligently a safety net.[2]
What does it mean that Git is distributed?
Every copy of a Git repository is a complete repository with the whole history, and none is technically the master of the others.[1] A repository is not a link to a server or a shadow of another repository, and Learn Git The Hard Way puts it as a slogan, that all repositories are born equal.[1] Git Workbook makes the same point in its first exercise: local work is done on a real repository, and the remotes with which it exchanges changes are repositories in exactly the same way.[6]
What is a branch in Git?
GIT intermediate reduces Git to a few abstractions: a repository is a directed graph of commits without cycles, a commit never changes, and what change are refs, names that point to commits as pointers do in programming.[3] A branch is a ref, and the commit it points to at a given moment is its tip.[3] When a commit is made on a branch, the commit the branch indicated becomes the parent of the new one and the branch moves forward to the new commit.[3]
How do I make my first pull request?
A pull request is a way of proposing and reviewing a change. In Collaborative Development using Git and GitHub (2019) the first pull request is a change made entirely in the browser, without copying the repository, with an automated build to catch mistakes, which suits a corrected word or a few lines of documentation.[5] The second uses the contributor's own computer and editor.[5]
Does Git still work when AI agents write the code?
Git in the Age of AI Agents. (2026) observes that agents now produce code faster than a team can understand, review and integrate it, and that this does not make Git obsolete but exposes what it was never designed to decide: who owns a task, which changes are authorised, in what order work is combined and when it must stop.[8] The book builds a system of control round the repository, with an isolated space for each agent, an explicit scope, reproducible evidence, ordered integration and human accountability.[8] A commit, it says, can show what changed but not what the agent was asked.[8]
Sources
Every source is a Leanpub book or course. The note after each says which part of it was read; where no sample was available, only the public description and table of contents were used.
- 1.Learn Git The Hard Way, Ian Miell Free sample: the foreword and the introduction, on source control, Git's design and its core concepts. 2022. Free sample: PDF · EPUB
- 2.Painless Git, Nate Dickson: A Sane Person's Guide to Distributed Development Free sample: the introduction, on what Git is and what the book aims to be. 2020. Free sample: PDF · EPUB
- 3.GIT intermediate, Jacek Drąg: Know abstractions you use Free sample: the preface and a chapter on refs and the current position. 2023. Free sample: PDF
- 4.Beginning Git Version Control, Makzan: Essential tips & tricks you need to get Git up and running. Free sample: the front matter and the opening of chapter one, on installation and configuration. 2021. Free sample: PDF · EPUB
- 5.Collaborative Development using Git and GitHub, Gábor Szabó: Adding Test and Continuous Integration with Travis-CI and AppVeyor Free sample: the introduction and the outline of the chapters. 2019. Free sample: PDF · EPUB
- 6.Git Workbook, Lorna Mitchell: Self-Study Guide to Git Free sample: the introduction and the first exercise. 2018. Free sample: PDF · EPUB
- 7.Essential Git, Jorge Escobar: Why spend hours learning all Git and Github? Learn the parts professional developers use and get on with your coding Free sample: the introduction, on the course and on what version control is. 2024. Free sample: PDF · EPUB
- 8.Git in the Age of AI Agents., Victor PEREZ: The Operational Playbook for Coordinating Engineers, Agents, and Subagents Without Losing Control of Your Application Free sample: the foreword and the notes on how to use the book. 2026. Free sample: PDF · EPUB
- 9.Juju-chu! — Starting Your Jujutsu × AI Workflow with `jj new`, Yuka Ooka Free sample: the contents and the preface. 2026. Free sample: PDF · EPUB
- 10.Practical Git and GitHub, Dinis Cruz: Real-world examples of solutions for problems that occurred during day to day Git/GitHub usage. No sample: from the description and table of contents. 2016.
- 11.Simply Git, iThinker Studio: Version Control with Ease No sample: from the description and table of contents. 2020.
- 12.Git, The Magic Notebook Understanding Version Control Through Stories, Abhishek Kumar: Finally understand Git. Not just commands, but WHY each feature exists. A story about four friends learning version control together. No sample: from the description. 2026.
- 13.Git, The Magic Notebook (Advanced), Abhishek Kumar: Master Recovery, Power & Advanced Git Workflows No sample: from the description. 2026.
- 14.Git: in easy steps, Quan Mai: With examples in Git Extensionss No sample: from the description and table of contents. 2017.
- 15.Introduction to Git and GitHub, Bobby Iliev No sample: from the description and table of contents. 2023.
- 16.Git Prodigy, Ebenezer Don: Mastering Version Control with Git and GitHub No sample: from the description and table of contents. 2023.
- 17.Everyday Git 2022 - Attaining code quality and keeping your team sane, Bryan Lim: Attaining code quality, creating high-quality software products and keeping your whole team sane. No sample: from the description.
- 18.Git for Beginners, Ganesh Bagaria: Learn Git and GitHub Step by Step, Without Fear — with a Real Project No sample: from the description. 2026.
- 19.
- 20.The Unix WorkbenchCourse, Sean Kross No sample: from the outline of the course version of the same book. 2017.
- 21.GitOps, Florian Beetz, Anja Kammer, Dr. Simon Harrer: Cloud-native Continuous Deployment No sample: from the description and table of contents. 2021.
- 22.Master GitOps with Argo CD, Kirshi Yin | Curious Devs Corner: A hands-on guide to managing Kubernetes with GitOps No sample: from the description and table of contents. 2025.
- 23.GitHub Actions A Complete Visual Guide, Reiner Braun: A Practical Guide from Foundations to Production Operations The free sample was not used: from the description and table of contents. 2026. Free sample: PDF · EPUB
- 24.Team Guide to Software Releasability, Manuel Pais, Chris O'Dell The free sample was searched for its treatment of version control only: otherwise from the description. 2021. Free sample: PDF · EPUB
- 25.DevOps Katas, Dave Swersky: Hands-On DevOps The free sample holds exercises for another tool: from the description and table of contents. 2018. Free sample: PDF · EPUB
- 26.Production Ready Data Science, Khuyen Tran: From Prototyping to Production with Python The free sample was consulted for its contents page only: otherwise from the description. 2025. Free sample: PDF · EPUB
- 27.Building reproducible analytical pipelines with R, Bruno Rodrigues, Phd No sample: from the description and table of contents. 2023.
Further reading
Other books in the library on neighbouring ground, not cited above.
- GitOps with ArgoCD, Sudhanshu Jaiswal: A Comprehensive Guide A handbook of deployment workflows driven from a repository, on one tool. 2026.
- GitOps the Hard Way, with Argo CD, Aymen El Amri: Build Real GitOps Pipelines From Empty Clusters to Automated Deploys The same practice built by hand, starting from empty servers. 2026.
- The Perfect Pipeline. Advanced CI/CD with GitHub Actions, Automated Testing, and AI Code Reviews, Edgar Milvus Build and delivery pipelines on a hosting service's automation, a volume in a longer series. 2026.
- Getting to Know IntelliJ IDEA, Trisha Gee, Helen Scott: Get up to speed on IntelliJ IDEA's New UI A guide to one development environment, including its integration with Git. 2024.
- Modern IT Automation with PowerShell, The DevOps Collective, Inc., Michael Zanatta: Modern Automation with PowerShell A textbook on a scripting language whose first part is on collaboration and source control. 2022. Free sample: PDF · EPUB
- Inevitable Decline of Your Software, Chris Fauerbach: ... and how to prevent it, from inception to delivery Why code bases decay during maintenance and how process can slow it. 2019. Free sample: PDF · EPUB
- The importance of software configuration management in testing, Nadia Cavalleri A short piece on configuration management as seen from a testing team. 2019.
