---
title: "Landing: rebase, test and push in one step for AI coding agents · Cork"
description: "Landing means getting finished work onto the shared branch in one step: rebase onto everyone else's commits, rerun the tests, then push only if they pass."
canonical: "https://corkcli.com/blog/landing-rebase-test-push"
last_updated: "2026-10-03"
published: "2026-10-03"
author: "Kevin Vera"
---

# Landing: rebase, test and push in one step for AI coding agents

Landing means getting finished work onto the shared branch in one step: rebase onto everyone else's commits, rerun the tests, then push only if they pass.

By Kevin Vera · October 3, 2026 · [Glossary](https://corkcli.com/blog/c/glossary) · 3 min read

**Landing** is the step that gets finished work onto the shared branch safely: rebase it onto whatever teammates (and their agents) pushed in the meantime, rerun the tests against that combined code, and push only if they pass, as one operation rather than three manual ones.

With [parallel AI coding agents](https://corkcli.com/blog/parallel-ai-coding-agents) it deserves a name of its own, because agents push often and the main branch moves under them constantly.

## How it works

Git will not let you overwrite history you have not seen. The git push documentation explains that a non-fast-forward push is refused by default because "the changes introduced by commit A will be lost," and that to keep both people's work you must "first fetch the history from the repository, create a history that contains changes done by both parties, and push the result back." It offers two ways: `git pull` (a merge) or `git pull --rebase`.

Done by hand, the safe sequence is:

```bash
git fetch origin
git rebase origin/main      # replay your commits on top of everyone else's
# resolve any conflicts
<run the test suite>         # on the combined code, not your old base
git push origin HEAD:main
```

Landing makes that one action. The tests are the part people and agents most often skip, and the part that matters: a rebase can succeed with no conflicts and still produce broken code (a [semantic merge conflict](https://corkcli.com/blog/semantic-merge-conflict)), because your commits were written against an older version of the code.

## Examples

- An agent finishes a task and runs `git push`. It is rejected because two other agents pushed first. Landing rebases its commit onto theirs, the tests fail because one of them renamed a helper the agent used, and the push is stopped with that failure in hand instead of reaching main.
- Five agents finish within minutes of each other. Each lands in turn; each one's tests run against the code the previous ones just pushed.

## How teams handle it

- **Manual rebase and push**, with tests run by habit. Fragile with many agents.
- **Merge queues.** GitHub's merge queue, for example, makes sure a pull request's changes "pass all required status checks when applied to the latest version of the target branch and any pull requests already in the queue." Strong, but tied to pull requests.
- **Pre-push hooks.** Git's `pre-push` hook can run the tests first; if it "exits with a non-zero status, `git push` will abort without pushing anything." It does not rebase for you.
- **[Trunk-based development](https://corkcli.com/blog/trunk-based-development-ai-coding-agents)** with small commits and fast CI.

Cork includes landing. Cork is the [coordination layer](https://corkcli.com/blog/coordination-layer-ai-coding-agents) for multiplayer coding agents: it keeps Claude Code, Codex and Cursor agents, on one machine or across a team's machines, from overwriting each other on one codebase, and hands each agent what the others already learned. With Cork, `git push` becomes one step that rebases onto teammates' commits, reruns the tests, and pushes.

## Related terms

- [Agent merge conflict](https://corkcli.com/blog/agent-merge-conflict)
- Semantic merge conflict
- Parallel AI coding agents
- [Agent collision](https://corkcli.com/blog/agent-collision)

## Sources

- <https://git-scm.com/docs/git-push>
- <https://git-scm.com/docs/git-pull>
- <https://git-scm.com/docs/githooks>
- <https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue>

## Related reading

- [How to land agent changes in one step: rebase, test and push](https://corkcli.com/blog/land-agent-changes-rebase-test-push): Land AI agent commits in one step: fetch, rebase onto teammates' work, rerun tests and push, using a script, a pre-push hook or a merge queue.
- [Humans and AI agents on one branch: how to coordinate](https://corkcli.com/blog/humans-and-ai-agents-same-branch): Share a branch between developers and AI coding agents without lost work: who owns which files, commit and rebase rhythm, safe pushes, and review rules.
- [Trunk-based development with AI coding agents](https://corkcli.com/blog/trunk-based-development-ai-coding-agents): Trunk-based development when AI coding agents write much of the code: short-lived agent branches, daily merges, feature flags, rebase-test-push, merge queues.
- [Parallel AI coding agents on a team: how to split who works on what](https://corkcli.com/blog/split-work-parallel-ai-coding-agents-team): How a team splits work across parallel AI coding agents: slice by code ownership, name shared files, one branch per agent, small tasks, and live coordination.

[All articles](https://corkcli.com/blog.md) · [Cork in Markdown](https://corkcli.com/index.md) · [llms.txt](https://corkcli.com/llms.txt)

This page in HTML: https://corkcli.com/blog/landing-rebase-test-push
