cli / cli/cli

Bug with the --exclude option for pr diff

Open
#13,022 6 comments 0 reactions 0 assignees View on GitHub
bug gh-pr priority-3
Dominant language
Go
Stars
46.3k
Forks
9k
Avg merge
2d 9h
Merged PRs (30d)
89

Description

### Describe the bug

When doing: `gh pr diff 123 --name-only --exclude '*.md'` only the first two file names are printed.

### Affected version

gh version 2.88.1 (2026-03-12)
https://github.com/cli/cli/releases/tag/v2.88.1

### Steps to reproduce the behavior

1. Type this `gh pr diff 123 --name-only --exclude '*.md'`
2. View the output ''
3. See error - incorrect behaviour in that no glob pattern actually works.

### Expected vs actual behavior

When using the `--exclude` option for `pr diff ..` I expect some files to be excluded, but the behaviour is irratic.

### Logs

N/A.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.