# Git Reword Commits

> Rewrite in-scope commit messages to single-line git-workflow messages with git history reword.

- Skill: `motlin/git-reword-commits` (Agent Skill)
- Install (CLI): `npx skillmds@latest add motlin/git-reword-commits`
- Raw SKILL.md: https://api.skillmd.com/api/skills/motlin/git-reword-commits/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: motlin (https://skillmd.com/u/motlin)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/motlin/git-reword-commits

---


# Git Reword Commits

Use the `code:cli` and `git-workflow` skills.

Use `git history reword` only. Do not use interactive rebase, amend, filter-branch, filter-repo, or replay. Do not change commit content, authors, dates, parents, or trees.

Default scope is commits on the current branch not on upstream, or not on `main`/`master` when no upstream exists. If the user asks for all branches, collect every local branch's unique commits not on its upstream or fallback base.

Read full messages:

```bash
git log --format='%H%n%B%n--END-COMMIT--' <range>
```

Draft a replacement one-line message for every commit. Show before/after for every commit and ask for confirmation.

Apply approved rewrites oldest first:

```bash
MSG="<new single-line message>" GIT_EDITOR='sh -c "printf %s\\n \"$MSG\" > \"$1\"" --' git history reword <sha>
```

If any rewrite fails, stop and report the SHA and error. Do not push.

