aaddrick/gh-cli-search/gh-search-commits
- community
Checking that the SKILL.md file is still in the repository.
Use when searching commit history across GitHub repositories - provides syntax for filtering by author, committer, dates, hashes, and merge commits with proper exclusion handling
Install
npx vskill@latest install aaddrick/gh-cli-search/gh-search-commitsSKILL.md
GitHub CLI: Search Commits
Overview
Search for commits across GitHub repositories using gh search commits. Filter by author, committer, dates, commit hashes, and more.
When to Use This Skill
Use this skill when searching commits across GitHub:
- Finding commits by author or committer across repos/orgs
- Searching commit messages for keywords across repositories
- Filtering by commit dates or hashes in specific repos
- Looking for merge commits across an organization
- Searching in specific repositories or organizations
- Need to exclude certain results (requires
--flag)
Syntax
Key Flags Reference
Author & Committer Filters
| Flag | Purpose | Example | |
|---|---|---|---|
--author <string> | Filter by author username | --author octocat | |
--author-name <string> | Filter by author name | --author-name "John Doe" | |
--author-email <string> | Filter by author email | --author-email john@example.com | |
--author-date <date> | Filter by authored date | --author-date ">2024-01-01" | |
--committer <string> | Filter by committer username | --committer octocat | |
--committer-name <string> | Filter by committer name | --committer-name "Jane Doe" | |
--committer-email <string> | Filter by committer email | --committer-email jane@example.com | |
--committer-date <date> | Filter by committed date | --committer-date "<2024-06-01" |
Commit Attributes
| Flag | Purpose | Example | |
|---|---|---|---|
--hash <string> | Filter by commit hash | --hash 8dd03144 | |
--parent <string> | Filter by parent hash | --parent abc123 | |
--tree <string> | Filter by tree hash | --tree def456 | |
--merge | Filter merge commits only | --merge |
Repository Filters
| Flag | Purpose | Example | |
|---|---|---|---|
--owner <strings> | Filter by repo owner | --owner github | |
-R, --repo <strings> | Search in specific repo | --repo cli/cli | |
--visibility <strings> | Filter by visibility | --visibility public |
Output & Sorting
| Flag | Purpose | Example | |
|---|---|---|---|
-L, --limit <int> | Max results (default: 30) | --limit 100 | |
--sort <string> | Sort by author-date or committer-date | --sort author-date | |
--order <string> | Sort direction: asc or desc | --order asc | |
--json <fields> | JSON output | --json sha,author,commit | |
-w, --web | Open in browser | -w |
JSON Output Fields
Available fields: author, commit, committer, id, parents, repository, sha, url
Exclusion Syntax (Critical!)
When using inline query exclusions (negations with -), you MUST use the -- separator:
✅ Correct: gh search commits -- "search-terms -qualifier:value" ❌ Wrong: gh search commits "search-terms" --flag=-value ❌ Wrong: gh search commits "search-terms" --flag=!value ❌ Wrong: gh search commits --author-not=username
Examples:
gh search commits -- "fix -author:dependabot"(exclude author)gh search commits -- "merge -committer:bot"(exclude committer)gh search commits -- "deploy -merge:true"(exclude merge commits)gh search commits -- "refactor -author-date:<2024-01-01"(exclude date range)
Why the `--` separator is required: The -- tells the shell to stop parsing flags and treat everything after it as arguments. Without it, -qualifier:value inside quotes may be misinterpreted.
Critical Syntax Rules
When to Use Flag Syntax vs Query Syntax
Decision Tree:
Flag Syntax (for positive filters):
Query Syntax with `--` (required for exclusions):
⚠️ NEVER mix both syntaxes in a single command!
1. Exclusions and Negations
CRITICAL: When excluding results, you MUST use query syntax with the -- separator.
Exclusion Syntax Rules:
- Use the
--separator before your query - Use
-qualifier:valueformat (dash prefix for negation) - Quote the entire query string
Examples:
Single exclusion:
Multiple exclusions:
Combine with positive filters using flags:
PowerShell exclusions:
Common Exclusion Patterns:
| User Request | Command | |
|---|---|---|
| "Find commits but not by bots" | gh search commits -- "deploy -author:dependabot -author:renovate" | |
| "Commits excluding merge commits" | gh search commits -- "feature -merge:true" | |
| "Commits not by specific author" | gh search commits -- "refactor -author:olduser" | |
| "Commits excluding specific date range" | gh search commits -- "bug -author-date:<2024-01-01" | |
| "Commits not by multiple committers" | gh search commits -- "fix -committer:bot -committer:ci" | |
| "Commits excluding specific email" | gh search commits -- "update -author-email:bot@example.com" | |
| "Commits not in specific repo" | gh search commits -- "security -repo:old/deprecated" |
2. Date Formats
Use ISO8601 format (YYYY-MM-DD) with comparison operators:
3. Quoting Rules
Multi-word search:
Date comparisons need quotes:
Common Use Cases
Find commits by author:
Search commit messages:
Find commits in date range:
Find merge commits:
Exclude bot commits:
Search by commit hash:
Find commits by email:
Common Mistakes
| Mistake | Problem | Fix | |
|---|---|---|---|
--author="NOT bot" or --committer=-user | Flag syntax doesn't support negation | Use query: -- "-author:bot" or -- "-committer:user" | |
gh search commits fix -author:bot | -author interpreted as flag | Use --: -- "fix -author:bot" | |
"deploy NOT author:bot" | NOT keyword doesn't work | Use -: -- "deploy -author:bot" | |
Mixing syntaxes: --author octocat "fix -committer:bot" | Can't mix flags with query qualifiers | Use query for all: -- "fix author:octocat -committer:bot" | |
--author-date 2024-01-01 without comparison | May not work as expected | Use: --author-date ">2024-01-01" | |
| Not quoting date comparisons | Shell interprets operators | Quote: "<2024-06-01" | |
--author @octocat | Invalid @ prefix | Drop @: --author octocat | |
PowerShell without --% | Breaks with exclusions | Add: gh --% |
Installation Check
If gh command not found:
If not authenticated:
Date Comparison Operators
>- After date>=- On or after date<- Before date<=- On or before date..- Date range:2024-01-01..2024-12-31
Related
- GitHub search syntax: https://docs.github.com/search-github/searching-on-github/searching-commits
- For searching other resources:
gh-search-code,gh-search-issues,gh-search-prs,gh-search-repos
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/gh-search-commits/SKILL.md
Popularity
- Repository stars
- 4
- 7-day trend score
- 8
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 4 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/aaddrick/gh-cli-search/gh-search-commits)