Git and version control
Commits, branches, merges, pull request descriptions and history.
Download all 25
- Recover lost Git work
Recovers commits, branches, stashes and staged files lost to a reset, rebase or dropped stash, using reflog and fsck after a backup, explaining each command. Use right after a git mistake.
- Resolve a merge conflict
Resolves merge, rebase or cherry-pick conflicts by reading both sides and their common base, keeps the intent of each, and asks when the intents contradict. Use when git stops on a conflict.
- Write a commit message
Writes a commit message that states what changed and why, in the repo's own convention, and flags staged changes that should be split. Use before committing.
- Write a pull request description
Writes a pull request description that tells reviewers why the change exists, what to look at first, how to test it and what could break. Use when opening a PR.
- Backport a fix to release branches
Plans backporting a fix to maintained release branches with cherry-pick -x, conflict handling where code has diverged, per-branch tests, version bumps and changelog entries. Use for patch releases.
- Choose a branching strategy
Recommends a branching and release strategy such as trunk-based, GitHub flow or release branches for a team's size, cadence and environments, with rules, protections and migration steps.
- Choose the right git undo
Works out exactly what needs undoing and whether it is shared, then gives the one right command among restore, revert, reset, amend and cherry-pick, with its effect and a check. Use mid-mistake.
- Clean up a branch's commit history
Plans an interactive rebase that turns a messy branch into logical, reviewable commits, with a backup, the exact todo list and a check that the code is unchanged. Use before merging a WIP branch.
- Coach git for non-developers
Teaches writers, designers and researchers the minimum git needed to contribute to a docs or content repo through a web editor, desktop app or terminal, one concept per turn with a small exercise.
- Configure branch protection
Designs branch protection or rulesets covering required checks, reviews, CODEOWNERS, linear history, signing, bypass, tag protection and merge queue, fitted to team size and release model.
- Conventional Commits rules
Makes the assistant write every commit in Conventional Commits 1.0.0 format, one logical change per commit, with honest breaking-change footers. Use in repos that release from commits.
- Explain a git error
Explains a git error or confusing state such as detached HEAD, rejected push or divergent branches in plain words, what caused it and the safest command to get out. Use when git stops you.
- Extract a folder into a new repository
Plans moving one directory such as a library or service into its own repository with its history, using git filter-repo, then rewires CI, package names, issues and references in the original repo.
- Fix line-ending churn
Diagnoses whole-file diffs caused by CRLF and LF, file mode or encoding differences across operating systems, then writes a .gitattributes, a one-time renormalise commit and per-machine settings.
- Git safety rules
Standing rules for an assistant or coding agent running git, with no force-push to shared branches, no rewriting published history, backups before rebase or reset, no secrets, and asking before push.
- Investigate why code changed
Investigates when and why a piece of code changed using blame, log search, pickaxe and linked pull requests, and writes a short evidence-backed history of the decision and who to ask.
- Purge a file from git history
Removes a large file or committed secret from all git history with git filter-repo, with a backup first, exact commands, force-push coordination and what every collaborator must do.
- Rebase stacked branches
Plans updating a stack of dependent branches after the base moves or a lower PR is squash-merged, using rebase --onto or --update-refs, with commands per branch, conflict expectations and backups.
- Set up commit signing
Sets up commit and tag signing with SSH or GPG keys step by step, with hosting-side verification, CI bot signing, and how a signature differs from a DCO sign-off. Use when signing is required.
- Set up shared git hooks
Sets up git hooks a whole team gets automatically, covering formatting, linting, secret scanning and commit messages, kept fast and mirrored in CI. Use when bad commits keep reaching review.
- Set up Git LFS
Sets up Git Large File Storage for a repository with tracking patterns, optional migration of existing large files, CI and clone settings, and storage and bandwidth quota considerations.
- Set up git on a new machine
Walks through a clean git setup on a new computer one step at a time, covering identity, default branch, editor, SSH key or credential helper, line endings and a test push, verifying each step.
- Split a large pull request into a stack
Splits a large pull request into a stack of small, independently reviewable PRs with their order, dependencies and the branch commands to build them. Use when a PR is too big to review well.
- Write a CODEOWNERS file
Writes a CODEOWNERS file from the repository layout and team structure, with ordered ownership rules, fallbacks, protection for sensitive paths and a check for files nobody owns.
- Write a .gitignore file
Writes a commented .gitignore for a stack and toolchain, keeps personal editor files in a global excludes file, never ignores lockfiles, and shows how to untrack files already committed.
Not: reviewing a PR's code (code-review).