agentleFS
ku5icku5ic/claude-kit/skills/git-patterns/SKILL.md

git-patterns

Skill2 starsChanged 7 days agoMITView on GitHub

Git workflow patterns covering Conventional Commits, interactive rebase, branch strategy, recovery with reflog, bisect, worktrees, and stash. Use whenever the project is a git repository (a `.git` directory present), OR the task involves a git operation (commit, branch, rebase, bisect, merge conflict, or recovering lost history), even if "git" is not mentioned by name.

  • Reads credentials
  • Deletes or force-pushes

The file

Files
SKILL.md

Git Patterns

Review checklist and the handful of git behaviors that are easy to get wrong. Command syntax is in the man pages; this file is what to flag and what to reach for.

Conventional Commits

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
  • feat bumps MINOR, fix bumps PATCH, everything else (docs, style, refactor, perf, test, chore, ci) bumps nothing.
  • Breaking change: ! after the type/scope, or a BREAKING CHANGE: footer. Either maps to MAJOR.
  • Match the project's existing style before assuming Conventional Commits (rules/workflow.md).

Reach for these

SituationTool
Commits lost after a bad rebase or resetgit reflog: every HEAD move is recorded; branch off HEAD@{n}
Need each commit in a series to buildexec lines in the rebase -i todo (exec make test)
Hunting the commit that broke somethinggit bisect run <cmd>: automates the whole search; exit 0 = good
Reviewing a branch mid-edit on anothergit worktree add <dir> <branch>: separate working tree, shared .git
Fixups for already-staged hunksgit absorb (see rules/tooling.md) beats hand-written rebase -i
A file is ignored and you cannot see whygit check-ignore -v <path> names the rule and its source line

Anti-patterns

failure: force-pushing to a shared branch The rule is rules/workflow.md section 1. To force-push your own remote branch, use --force-with-lease --force-if-includes: the first fails if someone else pushed since your last fetch, the second also fails when a background fetch updated the ref without you seeing it.

failure: committing secrets git rm does not remove it from history; the secret is still in every clone. Remediation is rotation: security-patterns' reference/secrets.md.

warning: merge commit spam on feature branches Merging main into a feature branch repeatedly to stay up to date produces a messy history. Prefer git rebase main on the feature branch to keep a linear history before merge.

warning: squashing a merge commit into a feature commit Interactive rebase cannot squash across a merge commit. Resolve by rebasing onto main first to linearize history, then squash.

warning: committing with --no-verify Skipping pre-commit hooks bypasses linting, type checks, and secret scanning. Only use if you understand exactly which hook is blocking you and why it is safe to skip in that moment.

warning: git reset --hard as a routine undo It discards working tree changes with no reflog entry for them. git reset --soft HEAD~1 keeps the changes staged and is the right default.

info: no .gitignore for secrets patterns An .env or *.key file not listed in .gitignore will eventually be committed by accident. Add secret file patterns before any other work in a new repo.


References

Version notes

Checked: 2026-09-26 against https://git-scm.com, https://github.com/git/git/blob/master/Documentation/RelNotes/2.30.0.adoc and https://www.conventionalcommits.org/en/v1.0.0/

  • git 2.55.0 (2026-06-29): no guidance change. git switch / git restore are the documented replacements for branch and file checkout; checkout still works.
  • --force-if-includes (2.30+): pairs with --force-with-lease against the background-fetch gap; added to the force-push guidance 2026-09-12.
  • Conventional Commits spec is 1.0.0; unchanged.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.