checkout
Checkout is the operation by which you retrieve a selected version of a project from the version control system to work on it on your own machine.
In plain terms
Developers keep program source code in version control software. It preserves every previous state of the files in a repository and also manages multiple parallel working versions (branches). Checkout is the command that selects a version from this repository and makes it appear on your machine, in the working directory.
It is like library borrowing: every edition of a manual is in the warehouse, and you check out the one you need at the moment. The term comes from the everyday English phrase 'check out', which also means library borrowing.
It is useful for switching in seconds between a feature in development, the stable release, and the state of the code six months ago, without losing anything. Coding agents often use it too: before touching the code, they check out the appropriate branch or open a new one for the task.
Do not confuse it with the "checkout" page of online stores, where you pay for the contents of your cart. The word is the same, but the meaning is entirely different.
How it works
- You specify what you need: the name of a branch, a tagged release, or the identifier of a specific previous commit.
- The version control system checks whether there are uncommitted changes on your machine that the switch would overwrite. If so, it stops and warns you. Git simply carries changes that cause no conflict over to the new version.
- It replaces version-controlled files in the working directory so that you see the requested version: anything differing in that version is overwritten, and anything not included is removed. It does not touch files never saved or not tracked by the version control system.
- It switches the internal 'where I am' marker (called HEAD in Git), so your next saves go to the selected branch.
- The previous version is not lost: it remains in the repository, and you can return to it at any time with another checkout.
An everyday example
You ask a coding agent to fix an error on your company website. In its log, you see: "git checkout -b hibajavitas", meaning it opened a separate branch and switched to it so the fix does not touch the live version. If automatic tests run on GitHub, the first step there is also "actions/checkout", which retrieves the code.
Who is affected
A common misconception
Limits and risks
- If you use checkout to restore certain files, unsaved changes may be lost without warning and irreversibly.
- If you check out a specific old backup instead of a branch, you enter a so-called 'detached HEAD' state, and backups created there can easily be lost if you do not create a branch for them.
- In Git, the command does too many things at once, making it confusing for beginners; there are now separate commands for the two main tasks (switch and restore).
- With a coding agent, make sure it does not switch branches in the same working directory where you are working, because the files get swapped out from under you.
Similar, but not the same
- cloning – Cloning copies the entire repository to your machine along with its history; checkout retrieves a version from this existing copy.
- commit – A commit saves your changes to the repository. A checkout works roughly in the opposite direction: it retrieves a previously saved state from the repository.
- online store checkout – The payment step in online shopping is also called checkout, but it has nothing to do with version control.
Related concepts
detached HEAD
A brief history
The term entered early version control systems from the English word for library lending, where a file's "checkout" also locked it for others. Git, released in 2005, uses it for version switching on your own machine; Git 2.23, released in 2019, introduced the switch and restore commands alongside it to separate the two tasks.
Where things stand
As of late 2026, checkout is a basic everyday operation in software development and almost always the first step in the workflows of coding agents and automated testing systems. In Git, switch and restore are gradually spreading alongside it, but the old command remains and is widely used.
In the news
- OpenAI releases GPT-6.1 Terra, which it says is strong at computer useOct 26, 2026 · Agent Age
- Payment and commerce infrastructure takes shape for AI agent purchasesOct 26, 2026 · Marketing
- Google's AI cart for checkout goes live ahead of holiday shopping; Merchant Center asks for new conversational attributesOct 26, 2026 · Marketing
- Shopify, Meta–Sierra, Cloudflare and UCP: online stores open up to AI agentsOct 19, 2026 · Marketing
- TikTok builds an agentic shopping assistant, direct checkout and an AI ad networkOct 19, 2026 · Marketing
- American Express publishes its standard for AI agent paymentsOct 14, 2026 · Money
- TikTok launches AI shopping assistant and one-click checkout in its appOct 5, 2026 · Marketing
- Constructor, DaVinci, Gladly and Topsort announce new agentic checkout toolsOct 5, 2026 · Marketing
Also known as
checkout · check-out · check out · git checkout · checkout · exception · branch switching · git switch
Sources
This entry was machine-edited and has undergone machine expert review; the “In the news” section updates automatically from Agent Age stories.