git-sync

A workflow for bringing a Git feature branch up to date with its base or upstream branch using a merge by default, or a rebase when explicitly requested. A branch is a separate line of code changes.

In plain words
What is it for?
Use it to merge updates from main or another base branch, explicitly rebase when desired, sync a fork with upstream, and identify conflicts.
Why use it?
It checks the actual branch and remote state before syncing, detects conflicts, and handles uncommitted changes safely instead of guessing.

Skill for Claude CodeCodex

Part of the cc-arsenal plugin — 53 skills shipped together

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/mgiovani/cc-arsenal/git-sync
Any agent
npx skills add mgiovani/cc-arsenal --skill git-sync
Clone the repo
git clone --depth 1 https://github.com/mgiovani/cc-arsenal

Made for: Claude Code, Codex.

Or install cc-arsenal, the plugin that ships this one along with the rest of its 53 skills.

Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,341 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.00094 $0.01341
Opus 5 $0.00047 $0.00671
Sonnet 5 $0.00019 $0.00268
Haiku 4.5 $0.00009 $0.00134

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

Security

Grade A, and why

git-sync 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 3d 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-sync/SKILL.md · 146 lines

How it starts

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

Git Sync

Sync the current branch with its base or upstream branch. Defaults to merge to preserve history; rebase is opt-in only. Only ever act on what git status and git log actually show: never guess branch state or conflicts.

Workflow

Phase 1: Detect & Decide

Run the following to understand current branch state:

git branch --show-current
git status --porcelain
git remote -v
git log --oneline HEAD..origin/main 2>/dev/null | head -20
git log --oneline origin/main..HEAD 2>/dev/null | head -20

Also check whether the branch is pushed to remote (git log origin/<branch>..HEAD: an error means local-only).

Determine the base branch (once, reuse the result for the rest of the run):

  1. User passed --base <branch>: use it.
  2. Otherwise gh pr view --json baseRefName -q .baseRefName 2>/dev/null (if an open PR exists).
  3. Otherwise git config branch.<name>.merge.
  4. Otherwise ask the user which base branch to use.

Determine sync strategy:

Merge (default): use when the branch has been pushed to remote, the user did not pass --rebase, or you are unsure.

Rebase (opt-in): use only when the user explicitly passed --rebase.

Fork sync (--upstream), sync from the upstream remote instead of origin: git fetch upstream && git merge upstream/<base>.

Display the detected state and proposed strategy before proceeding:

Current branch: feature/my-feature
Base branch:    main
Strategy:       merge (default)
Commits behind: 5
Commits ahead:  2
Dirty tree:     no

Phase 2: Pre-sync Safety

  1. Dirty working tree: with --stash, run git stash push -m "git-sync auto-stash" before syncing. Without --stash, abort and tell the user to commit, stash, or re-run with --stash.
  2. Fetch latest: git fetch origin (and git fetch upstream for fork sync).
  3. Re-check divergence after fetch so the numbers you report are accurate, not the pre-fetch snapshot.

Phase 3: Execute & Report

Merge: git merge origin/<base>

Read the full file on GitHub · 146 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 146 lines · 94 tokens per session scan A b9729cc00325

Subscribe to this mod's changes

git-sync is a skill published in the GitHub repository mgiovani/cc-arsenal (7 stars, last pushed 3d ago), licensed MIT. It adds 94 tokens to every session and 1,341 once invoked, about $0.0005 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.

Related

Other skills, from other repositories

lattice-init

Guided setup and upgrade-check experience for Lattice projects -- scans the repository, detects existing configuration and outdated conventions, suggests refiners and available upgrades in priority order, and creates or reconciles the .lattice/ config. Bridges the gap between installing skills and getting first value…

techygarg/lattice · 115 tokens

intelligent-investor-graham

Use Graham value investing for Is this investment or speculation, defensive stock screens, margin of safety, Mr. Market, allocation, funds, IPOs.

simbajigege/book2skills · 37 tokens

skill-to-workflow

将现有 Skill、Prompt、SOP 或 Agent 操作说明拆解为可执行、可监控、可重试的 Workflow 规格;识别真实节点、共享子工作流、工具调用、状态、分支、循环、 提示词、数据契约和验收方式。适用于用户要求把一个 Skill 转成工作流、节点图、 编排方案或 Workflow 实现规格时;不替代原 Skill 执行业务任务,也不在未要求时 绑定具体工作流平台或直接部署。.

simbajigege/book2skills · 120 tokens

query-loop-implementation

Implement a production-ready LLM query loop / agent loop for AI applications. Use this skill whenever the user wants to add tool calling, ReAct-style reasoning-action-observation cycles, function calling loops, query engines, agent runtimes, toolresult feedback, max-turn exits, or Claude Code-like Agent Loop behavior…

simbajigege/book2skills · 75 tokens

documentation-and-adrs

Records decisions and documentation. Use when making architectural decisions, changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase.

shashankswe2020-ux/whoop-mcp · 43 tokens

daily-life-discovery

Guide a consent-based conversation that helps a person discover how an AI agent could improve their day-to-day life: routines, friction, attention, decisions, relationships, learning, and small experiments. Use when someone asks for a daily check-in, wants the agent to learn how they work, says "grill me," wants a…

magnus919/agent-skills · 101 tokens