Command Palette

Search for a command to run...

Назад к скиллам
скилл № 83678

git

Git version control conventions and GitHub CLI workflows including commits, branches, pull requests, and code reviews with professional message practices. Use…

БесплатноБез исполняемых скриптов
lanejот lanej★ 41 звезда на GitHub

Установить git в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Git and GitHub

Standard git and gh usage works as documented. This file covers the conventions to hold to and the failure modes on this machine that have actually cost time.

Commits

  • Write commit messages directly from the staged diff and relevant context. /git:commit [context] provides the commit workflow.
  • For PR drafting, publication, and title/body revisions, use the pull-request workflow. It selects Octo when required or selected and otherwise uses the native review-platform workflow; writers remain separate from publication.
  • Format: Commitizen conventional, <type>(<scope>): <subject>, subject ≤ 50 chars.
  • AI attribution trailers (Co-Authored-By: Claude) in commits are fine.
  • Atomic commits; the message explains why.
  • Detected-By: trailer on any commit fixing a fault found after the code was written — the tier that caught it (V0–V4, see the verification reference) or user. This is measurement, not attribution.
  • --amend only when the user asked for it, or to fold in a pre-commit hook's own edits.

Pull requests

Before preparing a change for review or assessing merge readiness, read the project review procedure. It governs independent review, scoped repair, and exact-head validation for this installed profile; repository-specific instructions and publication authority remain binding.

Follow the pull-request workflow for repository templates, writing, publication, and verification of saved content. Creating or updating a PR does not authorize merging it.

Branch naming

feature/, fix/, hotfix/, refactor/, docs/, test/ + a descriptive slug.

Safety rules

Commit coherent, finished, verified project changes unless the task forbids it; preserve the user’s publication authority for pushes and PRs. Review the complete staged snapshot and avoid path-based commits that sweep in unrelated unstaged content. Never restore or reset someone else’s diff; inspect current history and ownership first. Use a task-owned WIP commit for a baseline check rather than the stash shared by worktrees.

  1. Never force-push to main/master — warn instead.
  2. Never --no-verify unless explicitly requested.
  3. --force-with-lease, never bare --force.
  4. Confirm authorship and push status before amending.
  5. Destructive commands need user confirmation.
  6. To check whether a merge would conflict before committing to a mechanism: run the real git merge --no-ff <branch>, inspect git status --short, then git merge --abort to fully revert — safer than eyeballing git diff/git log divergence and guessing. (detail: memory "reference_dry_run_merge_then_abort_conflict_check")

Worktree gotchas

gh pr checkout is not worktree-safe

It operates against the main git directory regardless of the shell's cwd. Run from inside a worktree, it switches the main working directory's branch and overwrites files there.

Instead, from inside the worktree:

git fetch origin <branch>
git checkout -b fix/<name> origin/<branch>

core.hooksPath is shared across all worktrees

It lives in the repo's shared .git/config as a single value. A sibling worktree running husky init silently overwrites it repo-wide with a path relative to its own worktree. Every other worktree's pre-commit hook then fires and does nothing — no error, the commit just lands as if lint-staged never existed.

Per worktree needing isolated hooks:

git config extensions.worktreeConfig true
git config --worktree core.hooksPath <relative-path-to-hooks-dir>

Applies to any hooks manager that writes core.hooksPath.

Diff and patch gotchas

git apply "does not exist in index" → check diff.noprefix

This machine sets diff.noprefix = true globally in ~/.gitconfig (confirm: git config --get diff.noprefix). It applies to every repo and strips the a//b/ prefixes, so headers read --- projects/foo/bar.qmd rather than --- a/projects/foo/bar.qmd. git apply defaults to -p1, which then eats a real path segment and reports the file as missing even though it is tracked at exactly that path.

Fix: pass -p0 for any hand-crafted or sub-agent-generated diff on this machine — git apply --cached -p0 <patch>. Check diff.noprefix first; this recurred across unrelated repos because it wasn't written down the first time.

git commit -m "..." -- <pathspec> stages the full working tree for those paths

It is not "commit what's staged, scoped to these paths" — it implicitly git adds the current working-tree content of every listed path, regardless of what was staged. In a shared working tree with unrelated uncommitted changes in the same files, that silently folds someone else's WIP into your commit.

Before any git commit -- <pathspec>: stage explicitly (git add -p, or git apply --cached -p0 against an extracted patch), com

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/review.md
  • references/verification-lessons.md
  • references/worktrees.md

FAQ

Что делает скилл git?

Git version control conventions and GitHub CLI workflows including commits, branches, pull requests, and code reviews with professional message practices. Use when managing commits, branches, PRs, or coordinating multi-worktree workflows. Don't use for deployment scripting or infrastructure-as-code (use other domain skills instead).

Как установить скилл git?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл git запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить git с