---
title: Affected
order: 2
description: "The set of projects touched by a change; magus affected <target> runs a target only over them."
tags: [glossary, execution-and-caching]
---

# Affected

The set of projects touched by a change; `magus affected <target>` runs a target
only over them.

## Elsewhere

Nx's `affected` and Turborepo's `--filter=[HEAD^1]` select projects from a git diff the same
way. magus reaches a project through the source globs it declares rather than through import
analysis, so a file outside every glob affects nothing.

## Example

```sh
magus affected ci
```

## Used in

<!-- BEGIN GLOSSARY USAGE (generated by glossary-usage-generate from the knowledge graph; edit the generator, not this list) -->

In the docs:

- [S3: Affected dry-run (1 file changed)](../benchmarks/build-tools.md#s3-affected-dry-run-1-file-changed)
- [How this connects to affected and the cache](../concepts/workspace.md#how-this-connects-to-affected-and-the-cache)
- [Affected](../concepts/workspace/affected.md#affected)
- [Sharding by affected project](../guides/integrations/github-actions.md#sharding-by-affected-project)
- [Re-run only affected projects on each save](../guides/tips.md#re-run-only-affected-projects-on-each-save)
- [Affected](../reference/api/graph/v1alpha1/graph.md#affected)

<!-- END GLOSSARY USAGE -->

## See also

- [Affected](../concepts/workspace/affected.md)
- [CI](ci.md)
