# Word diff

A word diff marks the words that changed instead of whole lines, which suits prose. How git diff --word-diff shows one, with an example on a paragraph.

**Definition:** A word diff is a comparison of two versions of a text that marks the individual words removed and added, instead of every line that changed.

## Why prose needs one

A line diff marks every line that changed. Code has short lines, so that works. A Markdown paragraph is often one long line, so changing one word marks the whole paragraph as removed and added, and you hunt for the difference. A word diff shows it in place.

## With Git

Add `--word-diff` to any `git diff` command:

```terminal
git diff --word-diff
```

```text
This week [-we shipped-]{+brought+} three small updates.
```

By default, Git treats anything between spaces as a word. Two other modes help:

- `--word-diff=color` shows the changes in color only.
- `--word-diff-regex=.` compares character by character, for typos and punctuation.

Git builds a word diff from its line diff, so on heavily rewritten text the output can be longer than a dedicated word-diff tool's.

## In Flywrite

Flywrite has no diff view: it saves checkpoints and restores from them. Each checkpoint is a Git commit, so in the project's terminal, `git diff HEAD --word-diff` shows the words changed since the latest [checkpoint](/glossary/checkpoint), in files that checkpoint already tracked. It needs Git on the command line.

## Questions

### What do [- -] and {+ +} mean in a word diff?

In Git's plain word diff, words between [- and -] were removed and words between {+ and +} were added. Everything else is unchanged.

### Can I see only the colors, without the brackets?

Yes. git diff --word-diff=color, or git diff --color-words, marks the changed words in color in your terminal.

## Sources

1. [Git documentation: git-diff](https://git-scm.com/docs/git-diff), checked 2026-11-10
2. [Flywrite docs: Checkpoints & versions](/docs/checkpoints-and-versions), checked 2026-11-17

---

This is the Markdown copy of https://flywrite.app/glossary/word-diff.
