git-workflow

A guide to Git workflows, including branching, merging, rebasing, conflict resolution, stashing unfinished work, undoing mistakes, and release tagging. Git is a tool for tracking code changes, while a branch is a separate line of work.

In plain words
What is it for?
Use it when choosing a branching strategy, deciding between merge and rebase, resolving conflicts, saving work temporarily, undoing changes, or preparing a tagged release.
Why use it?
It helps developers choose a suitable way to integrate changes and recover from common version-control problems. It also clarifies which related procedures belong to separate guides.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/pekral/cursor-rules/git-workflow
Any agent
npx skills add pekral/cursor-rules --skill git-workflow
Clone the repo
git clone --depth 1 https://github.com/pekral/cursor-rules

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,617 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00043 $0.02617
Opus 5 $0.00022 $0.01308
Sonnet 5 $0.00009 $0.00523
Haiku 4.5 $0.00004 $0.00262

Measured 2d ago against content hash 7c4d71c37cac, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

git-workflow scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/git-workflow/SKILL.md · 200 lines

How it starts

The opening of the file, as written. The whole thing — 200 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Constraints

  • Commit, PR, and merge conventions live in @rules/git/general.mdc — English type(scope) commits, lowercase, no trailing period, no push to main, small focused commits, Closes # issue linking, English PR titles, rebase-and-merge, gh CLI. This skill does NOT restate them.
  • Branch cleanup is owned by @skills/cleanup-local-branches/SKILL.md. Defer to it; do not duplicate.
  • PR merging is owned by @skills/merge-github-pr/SKILL.md. Defer to it; do not duplicate.
  • This skill covers only the complementary gaps below.

Use when

  • Choosing or changing a branching strategy.
  • Deciding merge vs rebase for a specific situation.
  • Resolving a merge conflict.
  • Stashing work in progress.
  • Undoing a mistake (bad commit, wrong reset, accidental change).
  • Cutting a release and tagging a version.

Branching strategies

GitHub Flow (simple, recommended for most)

main is always deployable. Branch from main, open a PR, merge after review and green CI, deploy. Best for SaaS and web apps with continuous deployment.

Trunk-based (high-velocity)

Everyone integrates into main via very short-lived branches (1–2 days). Incomplete work hides behind feature flags. CI must pass before merge. Needs strong CI/CD and discipline.

GitFlow (release-cycle driven)

main holds production code, develop is the integration branch, with release/* and hotfix/* branches. Heavyweight; only worth it for scheduled, regulated releases.

Strategy Team size Release cadence Best for
GitHub Flow any continuous SaaS, web apps, startups
Trunk-based 5+ experienced multiple/day high-velocity teams using feature flags
GitFlow 10+ scheduled enterprise, regulated industries

Default to GitHub Flow unless the team has a concrete reason for another model. It aligns with the rebase-and-merge + short-focused-branches conventions in @rules/git/general.mdc.

Merge vs rebase mechanics

Read the full file on GitHub · 200 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 200 lines · 43 tokens per session scan A 7c4d71c37cac

Subscribe to this mod's changes

git-workflow is a skill published in the GitHub repository pekral/cursor-rules (6 stars, last pushed 7d ago), licensed MIT. It adds 43 tokens to every session and 2,617 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.