gh copilot explain n’écrit pas le message ; suggest si
explain explique. suggest + git rédige la ligne.
gh copilot explain answers what a command means. It does not stage files or print git commit -m for you. The first commit message that is not garbage usually comes from gh copilot suggest with git command after git add. To line up the steps, open a room on oakmeet.
The searchable mistake is using gh copilot explain to draft a commit message. The extension README lists explain and suggest separately. Commit text is a suggest job. Checked against Using Copilot in the CLI and the github/gh-copilot readme (deprecated 2025-10-25 in favor of GitHub Copilot CLI).
explain reads; suggest proposes
gh copilot explain
Pass a shell string, for example gh copilot explain 'git commit --amend'. Copilot explains steps and flags. It does not read your index or invent a subject line from staged hunks.
gh copilot suggest
Ask in plain language, then choose git command when prompted. Copilot may offer git commit -m "...". Use copy or execute only after you read the line against git diff --cached.
| Goal | Command | Good enough to commit? |
|---|---|---|
Understand git commit --amend | gh copilot explain | No — you still write the message |
| Draft message for staged work | gh copilot suggest + git | Only after you edit the subject |
| Open the first PR from terminal | gh pr create | Different page — URL on success |
Four steps to a line you can defend
- 01gh auth login
Use the GitHub CLI OAuth flow. The gh-copilot readme: classic and fine-grained PATs in
GH_TOKEN/GITHUB_TOKENare unsupported for this extension. Confirm withgh auth status. Copilot seat and org policy “Copilot in the CLI” must allow CLI use. - 02Install the gh-copilot extension
gh extension install github/gh-copilot --force.gh copilot --helpshould listexplainandsuggest. Optional:gh copilot aliasforghcs/ghce. - 03Stage something real, then diff
Make a small, intentional change.
git addonly what belongs in this commit. Rungit diff --cached. If the diff is empty, suggest has nothing useful to summarize. - 04suggest, pick git, read before commit
gh copilot suggest "Commit message for staged changes: state what changed and why". Select git command. Reject one-word subjects likefixorupdate. Prefer copy, edit, then rungit commityourself if execute feels too fast.
gh auth login
gh extension install github/gh-copilot --force
git add src/auth.go
git diff --cached
gh copilot suggest "One-line subject + optional body for these staged changes"
# choose: git command → read → copy or executeexplain is for learning a command. suggest is for a draft commit line. Neither replaces reading the diff.
- Why explain gave a essay, not -m
- explain is documented as “Explain a command,” not “summarize my index.” No staged context is implied.
- Garbage one-liners
- Copilot may still propose vague text. If the subject could apply to any repo, revise before
git commit. - ghcs shortcut
gh copilot aliasaddsghcsfor suggest andghcefor explain. Same split: commit drafts go through suggest.
Put explain vs suggest on one board
Two people mixing up “explain the amend flag” and “write tonight’s commit” can draw two columns on one page. oakmeet is a browser whiteboard: space code in, no account. It is not the gh-copilot extension.
Back in the repo: run gh pr create only after commits exist. For IDE Copilot, see Copilot Chat in VS Code. Short alignment: start a room.
Can gh copilot explain write my commit message?
No. explain takes a command string and explains it. Drafting git commit -m for staged work is gh copilot suggest with git command type.
What if suggest wants to run commit for me?
The UI offers explain, execute, copy, revise, exit. Copy lets you edit the subject. Execute runs the suggested command — only after the message matches the diff.
Is this the same as gh copilot with no subcommand?
Newer gh builds can launch the standalone GitHub Copilot CLI agent. This article is about the gh-copilot extension subcommands explain and suggest, not gh pr create.
Does oakmeet commit for me?
No. oakmeet is a short-lived browser room. The start link only spreads the command list.