git-essentials

Git workflow guidance for managing branches, combining changes, cleaning up project history, and recovering from mistakes. Git is a tool that records code changes and lets developers work on separate versions of a project.

In plain words
What is it for?
Creating branches, resolving merge conflicts, rebasing, cherry-picking commits, investigating history, and recovering from resets or other mistakes.
Why use it?
It helps avoid losing work or accidentally combining incompatible changes. It also makes conflicts and past changes easier to understand and fix.

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/asgarovf/locusai/git-essentials
Any agent
npx skills add asgarovf/locusai --skill git-essentials
Clone the repo
git clone --depth 1 https://github.com/asgarovf/locusai

Made for: Claude Code, Codex.

Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 681 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.00034 $0.00681
Opus 5 $0.00017 $0.00341
Sonnet 5 $0.00007 $0.00136
Haiku 4.5 $0.00003 $0.00068

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

Security

Grade A, and why

git-essentials 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-essentials/SKILL.md · 115 lines

How it starts

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

Git Essentials

When to use this skill

  • Creating and managing branches
  • Resolving merge conflicts
  • Rebasing and cleaning up history
  • Cherry-picking commits
  • Investigating history with git log/blame/bisect
  • Recovering from mistakes (reset, revert, reflog)

Branching Strategy

Branch naming

feat/<issue>-<short-description>
fix/<issue>-<short-description>
chore/<short-description>
release/<version>
hotfix/<issue>-<description>

Common workflows

# Create feature branch from main
git checkout main && git pull
git checkout -b feat/123-add-auth

# Keep branch up to date with main
git fetch origin
git rebase origin/main

# Squash commits before merge
git rebase -i origin/main
# Mark commits as 'squash' or 'fixup'

Conflict Resolution

Strategy

  1. Understand both sides of the conflict
  2. Determine which changes to keep (or merge both)
  3. Test after resolution
  4. Never blindly accept "ours" or "theirs"
# See which files conflict
git status

# Use merge tool
git mergetool

# After resolving manually
git add <resolved-files>
git rebase --continue   # or git merge --continue

History Investigation

# Search commits by message
git log --grep="fix auth"

# Find who changed a line
git blame <file> -L <start>,<end>

# Find which commit introduced a bug
git bisect start
git bisect bad HEAD
git bisect good v1.0.0
# Git will binary search — test each commit and mark good/bad

# Show changes to a specific function
git log -p -S "functionName" -- <file>

Recovery

# Undo last commit (keep changes staged)
git reset --soft HEAD~1

# Find lost commits
git reflog

# Restore a deleted branch
git checkout -b <branch> <reflog-sha>

# Revert a pushed commit (creates new commit)
git revert <sha>

# Unstage files
git restore --staged <file>

# Discard working tree changes
git restore <file>

Best Practices

  1. Commit often — small, atomic commits are easier to review and revert
  2. Pull before push — avoid unnecessary merge commits
  3. Don't rewrite shared history — never force-push to main/master
  4. Use .gitignore — keep build artifacts, secrets, and IDE files out
  5. Write meaningful messages — future-you will thank present-you
  6. Review diffs before committinggit diff --staged catches mistakes

Read the full file on GitHub · 115 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 · 115 lines · 34 tokens per session scan A 67c4d10a0710

Subscribe to this mod's changes

git-essentials is a skill published in the GitHub repository asgarovf/locusai (23 stars, last pushed 5mo ago), licensed MIT. It adds 34 tokens to every session and 681 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-30.