Skip to content

Commit a2d5f85

Browse files
docs: note that --diff-branch requires a locally resolvable ref
1 parent f7e73d6 commit a2d5f85

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ repos:
4848

4949
With this flag, the hook checks whether each migration file exists on the specified branch. Files that already exist are skipped. New files (not yet on the branch) are linted. This makes `pre-commit run --all-files` safe to run in repos where older migrations would fail linting.
5050

51+
The value must be a ref that resolves locally via `git rev-parse --verify`. In CI environments with shallow checkouts or no local tracking branch, use the remote form:
52+
53+
```yaml
54+
args: [--diff-branch, origin/main]
55+
```
56+
5157
## How It Works
5258

5359
When pre-commit runs, the hook:

0 commit comments

Comments
 (0)