# Modern Git

> Modern Git workflows, best practices, and commands. Use when the user asks about Git branch management (git switch vs checkout), file restoration (git restore), fixup commits, autosquash rebasing, git worktrees, rerere, force-with-lease, repository cleanup (git clean, stale branches, bloat analysis), history navigation (revision syntax, range notation, pickaxe search), recommended global git config, or GitButler and the but CLI.

- Skill: `jamie-bitflight/modern-git` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add jamie-bitflight/modern-git`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jamie-bitflight/modern-git/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Jamie-BitFlight (https://skillmd.com/u/jamie-bitflight)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/jamie-bitflight/modern-git

---


# Modern Git

Full reference: [./references/git-workflows.md](./references/git-workflows.md) — read it when answering any question this skill covers.

## Quick Navigation

| Topic | Section |
|---|---|
| `git switch` / `git restore` (replace `checkout`) | §1 |
| Topic branches, throw-away branches, merge-upwards | §2 |
| Fixup commits, autosquash, worktrees | §3 |
| `rerere`, native GitButler alternatives | §4 |
| Recommended global config | §5 |
| `--force-with-lease`, pickaxe, `git maintenance` | §6 |
| Repo cleanup, bloat analysis, stash, `.mailmap` | §7 |
| Command cheat sheet | §8 |
| Revision syntax, range notation, reflog | §9 |
| GitButler desktop + `but` CLI install | §10 |

