skills/smithery.ai/git-best-practices

git-best-practices

SKILL.md

Git Best Practices

Safety Rules

  • Read-only by default: Prefer git status, git diff, git log, git show, git blame before making changes
  • Push requires explicit request: Never push unless user asks
  • Checkout allowed for: PR review, explicit user request
  • Branch changes require consent: Ask before creating/switching branches
  • History rewriting requires consent: Ask before commit --amend, interactive rebase, or force push (especially if anything may be shared)
  • Destructive ops require explicit user consent:
    • Allow previews like git clean -n (no deletion); do not run git clean -fd without consent
    • Do not discard worktree changes with git reset --hard or git restore . without consent
    • Do not delete branches/tags or force push without consent

Preferred Commands

  • Prefer modern porcelain: git switch (branches) and git restore (undo) when appropriate
  • git restore --staged <path> is usually safe; discarding worktree changes (e.g., git restore .) requires explicit consent
Installs
2
First Seen
Mar 20, 2026
git-best-practices from smithery.ai