git-workflow
Git Workflow
Safe, non-interactive approaches for squashing commits and rebasing feature branches.
Tip: If jj is available (
jj rootsucceeds), prefer jj-workflow—it's simpler and has automatic safety via oplog.
Squash N Commits
git reset --soft HEAD~3
git commit -m "Your consolidated message"
That's it. The --soft flag keeps your changes staged and ready to commit.
Rebase Feature Branch
Update dev first, then rebase:
git fetch origin dev && git checkout dev && git pull
git checkout my-feature
git rebase --committer-date-is-author-date dev
git push -f origin my-feature
The --committer-date-is-author-date flag puts your feature commits on top chronologically.
Key Safety Rules
- Never rebase shared branches — only rebase local feature branches
- Check
git statusfirst — ensure no uncommitted changes - Create a backup branch:
git branch backup-$(date +%s) - Review changes before committing:
git diff --cached
Pre-Commit Hook Changes
If hooks modify files during commit, stage and amend:
git add .
git commit --amend --no-edit
When Things Go Wrong
git rebase --abort # Stop rebase, go back
git reflog # See recent commits
git reset --hard <commit-hash> # Recovery
See REFERENCE.md for detailed workflows and troubleshooting.
More from trevors/dot-claude
jj-workflow
Jujutsu (jj) version control, load skill when hook output shows vcs=jj-colocated or vcs=jj in the system-reminder.
93notion-formatter
Format markdown content for Notion import with proper syntax for toggles, code blocks, and tables. Use when formatting responses for Notion, creating Notion-compatible documentation, or preparing markdown for Notion paste/import.
47book-reader
Read and search digital books (PDF, EPUB, MOBI, TXT). Use when answering questions about a book, finding quotes or passages, navigating to specific pages or chapters, or extracting information from documents.
44using-jj
Advanced jj/jujutsu workflows — revsets, absorb, evolog, op restore/undo, immutable_heads bypass, divergent-change resolution, jj split, parallel jj new, conflict-after-rebase, force-push recovery. Contains non-obvious rules (e.g., always `-m` to avoid editor) that prevent broken workflows. Skip for simple commit/push/rebase.
43svelte5
Svelte 5 syntax reference. Use when writing ANY Svelte component. Svelte 5 uses runes ($state, $derived, $effect, $props) instead of Svelte 4 patterns. Training data is heavily Svelte 4—this skill prevents outdated syntax.
39maintaining-claude-code
Create, validate, and improve Claude Code configuration — SKILL.md files, CLAUDE.md, rules, hooks, and settings.json. Use when creating a new skill, writing a SKILL.md, adding a hook, editing rules, auditing skill descriptions, checking config quality, debugging hook behavior, or deciding between skills vs rules vs CLAUDE.md. Also auto-loads when working in ~/.claude/ on skills, rules, hooks, or settings.
32