Skip to content
Agentmart
Submit a tool

modern-git-patterns

Use when working with git commands, planning git workflows, advising on git best practices, or needing version-aware git guidance.

Skill by kvithayathil

IndexedApache-2.0
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/kvithayathil-modern-git-patterns

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when working with git commands, planning git workflows, advising on git best practices, or needing version-aware git guidance. Provides modern patterns, commands, and approaches for git 2.50+. Covers history rewriting, maintenance, sparse operations, config-based hooks, signing, blame techniques, partial clone, and workflow patterns. Triggers on: git, rebase, merge, branch, commit, blame, diff, bisect, worktree, stash, submodule, hook, maintenance, sparse-checkout, partial clone, signing, force push, reflog, cherry-pick.

Use cases: productivity

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Shell scripts

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/modern-git-patterns

What's inside

Skill name
modern-git-patterns
Description
Use when working with git commands, planning git workflows, advising on git best practices, or needing version-aware git guidance. Provides modern patterns, commands, and approaches for git 2.50+. Covers history rewriting, maintenance, sparse operations, config-based hooks, signing, blame techniques, partial clone, and workflow patterns. Triggers on: git, rebase, merge, branch, commit, blame, diff, bisect, worktree, stash, submodule, hook, maintenance, sparse-checkout, partial clone, signing, force push, reflog, cherry-pick.
License
Apache-2.0
Metadata
author: kvithayathil · living: true · version: 1.0.0 · last-reviewed: 2026-04-21 · self-learning: true · self-updating: true · update-policy: evolve-on-evidence · min-git-version: 2.50.0 · verified-git-version: 2.54.0
Instructions
473 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts
  • Instructions read files in your home folder (~/.ssh, ~/.aws…)

Files (8)

  • SKILL.md
  • CHANGELOG.md · references/
  • COMMAND_QUICK_REFERENCE.md · references/
  • DETAILED_PATTERNS.md · references/
  • LESSONS_LEARNED.md · references/
  • SOURCES.md · references/
  • VERSION_FEATURE_MAP.md · references/
  • reject-internal-dirs.sh · scripts/

SKILL.md (first lines)

# Modern Git Patterns, Commands & Approaches

Version-aware git guidance grounded in git 2.50–2.54 release notes, expert talks, and real-world practice.

## Version Detection

Before advising on any git command, check the available version:

```bash
git --version
```

If version < 2.50, note that many patterns below are unavailable or behave differently.
Feature availability annotations use `[2.XX+]` to indicate minimum git version.
## Section Index

| Section | Focus |
|---------|-------|
| [History Rewriting](#history-rewriting) | reword, split, replay, rebase |
| [Safety Patterns](#safety-patterns) | force-with-lease, reflog, rerere |
| [Maintenance & Performance](#maintenance--performance) | geometric repack, commit-graph, fsmonitor |
| [Sparse & Partial Operations](#sparse--partial-operations) | sparse-checkout, partial clone, backfill |
| [Config-Based Hooks](#config-based-hooks) | declarative hooks in gitconfig |
| [Signing & Verification](#signing--verification) | SSH signing, expired key handling |
| [Blame & History Investigation](#blame--history-investigation) | blame -C, -L, --diff-algorithm, log -L |
| [Diff & Merge Patterns](#diff--merge-patterns) | word-diff, histogram, rerere, merge-conflict recording |
| [Worktree & Multi-Branch](#worktree--multi-branch) | worktree, virtual branches |
| [Stash Patterns](#stash-patterns) | stash --index, import/export |
| [Submodules & Alternatives](#submodules--alternatives) | submodule, subtree, package managers |
| [Status & Comparison](#status--comparison) | status.compareBranches, column UI |
| [Alias & Config Patterns](#alias--config-patterns) | includeIf, non-ASCII aliases, column.ui |
| [Bisect & Debugging](#bisect--debugging) | binary search for regressions |
| [HTTP & Remote Patterns](#http--remote-patterns) | 429 retry, prefetch, bundle URIs |
| [Deprecation Warnings (Git 3.0)](#deprecation-warnings-git-30) | upcoming breaking changes |

---
## History Rewriting

### `git history` (experimental) [2.54+]

Targeted history rewriting without the complexity of interactive rebase.

**Reword a commit message** without touching working tree or index:

```bash
git history reword <commit>
```

**Split a commit** into two by selecting hunks (uses `add -p` style interface):

```bash
git history split <commit>
```

Limitations: No merge commit support. Refuses operations that would cause conflicts.
Works in bare repositories. Built on `git replay` machinery.

### `git replay` (experimental) [2.53+]

Replay commits onto a new base without touching working tree. Safer than rebase for
scripting.

```bash
# Replay range onto new base
git replay --onto <new-base> <upstream>..<branch>

# Revert mode [2.54+]
git replay --revert <upstream>..<branch>

# Now performs atomic ref updates by default [2.53+]
# (instead of printing update-ref commands to stdout)

# Drop commits that become empty during replay [2.54+]
```

Can replay down to root commit [2.54+].

### `git rebase` with trailers [2.54+]

```bash
git rebase --trailer "Reviewed-by: A U Thor <author@example.com>"
```

Appends a trailer to every rebased commit via `interpret-trailers` machinery.

---

## Safety Patterns

### `--force-with-lease`

**Always prefer** `--force-with-lease` over `--force`. Checks that remote ref hasn't
changed since your last fetch before force-pushing.

```bash
git push --force-with-lease
```

If someone else pushed to the same branch, the push is rejected. Much safer than
blind `--force`. Works by comparing your local remote-tracking ref with the actual
remote ref.

### Reflog: Your Safety Net

Reflog records every HEAD movement (commit, checkout, merge, reset, rebase).
Entirely local — not shared with remotes.

```bash
# View reflog with dates
git reflog --date=relative

# Pretty format
git reflog --pretty=format:'%h %gd %gs %ci'

# Recover a "lost" commit
git checkout <reflog-hash>
# or create a branch from it
git branch recovered-work <reflog-hash>
```

From kvithayathil/agent-resources, Apache-2.0.

More from kvithayathil/agent-resources

Signals

Stars
0
Forks
0
Open issues
1
Last commit (this folder)
Jul 13, 2026 (3 months ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
1.0.0
License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from kvithayathil

Cite this page

modern-git-patterns skill. Agent Mart. https://agentmart.dev/skills/kvithayathil-modern-git-patterns (last updated 2026-10-24)