# How to keep documentation up to date as your code changes

Why docs drift from code, and how to update only the pages a commit affects without overwriting what your team edited by hand.

On this page

- Why documentation goes stale
- Update only what a change affects
- Respect hand edits
- See exactly what happened
- Frequently asked questions
- Keep reading

## Why documentation goes stale

Docs usually drift because updating them is a separate task from changing the code. The change ships, the page does not, and nobody notices until a reader follows outdated steps.

Rewriting everything on every commit is not the answer either. It is slow, it creates noise, and it throws away edits people made on purpose.

## Update only what a change affects

Docup records which source files each page was written from. When you push to your default branch, GitHub tells Docup the code changed, and Docup compares the changed files with those sources.

- Pages whose sources did not change are skipped.
- Affected pages are rewritten from the new code.
- Duplicate and out-of-order notifications from GitHub are ignored.

## Respect hand edits

If someone edited a page by hand, Docup does not touch it. Instead it shows a suggestion with what changed and why, and you accept or dismiss it. Pages you never edited can publish by themselves, or you can turn that off so every update waits for review.

## See exactly what happened

Every sync is a run in the dashboard, with the commit, the pages it touched and the result. If a page fails the run is marked partial, the other pages still update, and you can retry the failed one.

## Frequently asked questions

**How do I automatically update documentation after a GitHub push?**: Connect the repository to Docup. On each push to the default branch it updates the pages whose source files changed and leaves the others alone.

**Will automatic updates overwrite my edits?**: No. Pages you edited by hand are never overwritten. They get a suggestion you can accept or dismiss.

**Can I review updates before they go live?**: Yes. Turn off automatic publishing and every update waits for your review.

## Keep reading

- [GitHub Documentation Generator](https://docup.dev/guides/github-documentation-generator)
- [How to Verify AI-Generated Documentation](https://docup.dev/guides/verify-ai-generated-documentation)
- [Docup Sync](https://docup.dev/product/sync)

Last updated November 3, 2026
