# Fast-Forward Merge

> A merge where Git just slides the branch forward. No merge commit is made.

**Field:** Software Development  
**Category:** Version Control  
**Also known as:** Fast Forward, Fast-Forward, ff-only

## Think of it like

Think of it like catching up on a book. You just turn ahead to the page your friend reached.

## Definition

A fast-forward merge happens when the target branch has not moved since the other branch split off. There is nothing to combine. Git just moves the branch label forward to the newest commit. No new merge commit is made, and the history stays in one straight line. If both branches have new commits, a fast-forward is not possible.

## Example

Nobody touched main while Emma worked. Her merge is a fast-forward, and main now points at her last commit.

## Example code

```console
$ git merge --ff-only add-dark-mode
Updating 4c5d6e7..9f8e7d6
Fast-forward
 style.css | 4 ++++
 1 file changed, 4 insertions(+)
```

Main had no new commits, so Git only moved it forward.

## Why it matters

It keeps history in a straight line that is easy to read.

## Common mistake

Expecting a fast-forward every time. Once main has new commits, Git needs a real merge or a rebase.

## Three principles

- **Nothing to combine.** Only one side has new commits.
- **Label slides.** The branch just moves forward.
- **Straight history.** No extra merge commit.

## Related terms

- [Merge](https://learn.benibix.com/term/development/merge)
- [Rebase](https://learn.benibix.com/term/development/rebase)
- [Squash Merge](https://learn.benibix.com/term/development/squash-merge)
- [Branch](https://learn.benibix.com/term/development/branch)

## Told apart from

- [Squash Merge vs Fast-Forward Merge](https://learn.benibix.com/compare/squash-merge-vs-fast-forward-merge): People think a squash merge and a fast-forward are the same, because both leave main in a straight line. They are not. A fast-forward makes no new commit. Main's label just slides onto the branch's own commits, so every one of them is kept. A squash merge makes one new commit for the whole branch, and the branch's own commits stay off main.

## Taught in

- [Git Merge and Conflicts](https://learn.benibix.com/learn/development-version-control/git-merge-and-conflicts): Git and GitHub, 5/13

![A main branch runs along the top. A feature branch splits off it, gets two commits, and comes back three ways. Fast-forward: main had no new commits, so its label just slides forward to the feature's last commit. Squash merge, lit up: the two feature commits become one new commit on main. Merge commit: a new commit with two parents joins both lines.](https://learn.benibix.com/diagrams/dev3-branch-merges.svg)

---

Source: https://learn.benibix.com/term/development/fast-forward-merge
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
