CruxDevCruxDev Tools Prompts
dev Utility • Zero-Server Privacy • 100% Client-Side

Git Command Studio & Cheatsheet

Interactive command builder and troubleshooter for undoing commits, interactive rebasing, stashing, and branch workflows.

Overview

A searchable scenario book for Git: instead of typing a situation into a generator, you search a curated set of problem cards, each with a short description, the exact command or command sequence, and a copy button. Cards are grouped into three categories: Undo & Fix Commits, Branching & Stash, and Rebase & Sync. Search matches card names, commands, and descriptions.

How It Works

Type what you are trying to do into the search box, for example undo commit, rebase, or stash, and the matching cards from all three categories are shown live with their category headings. Each card states the problem in one line, explains what the command does and its danger level where relevant, and shows the command in a selectable block with a Copy Command button. Clearing the search box shows every card in all categories.

Step-by-Step Usage Guide

  1. Type your problem into the search box, such as undo, squash, or force push.
  2. Read the card's description, especially any warning about destructive commands.
  3. Copy the command with its button and run it in your terminal.
  4. Clear the search to browse all scenarios by category when you are unsure what to look for.

Technical Specifications & Standards

The card set is built around the operations people actually get wrong, and the ordering within each group is didactic. Undo & Fix Commits distinguishes the three reset modes by where your changes end up: git reset --soft HEAD~1 keeps them staged, git reset HEAD~1 unstages them, and git reset --hard HEAD combined with git clean -fd deletes them permanently, which the card marks as dangerous in its description. The amend card covers message edits, and revert is presented as the safe inverse for commits that are already pushed, because it adds a new commit instead of rewriting shared history. Branching & Stash covers creating and switching branches plus the stash lifecycle, and Rebase & Sync covers syncing with rebase, interactive rebase for squashing, and force-push with lease. The force-with-lease card is the one to internalize: it refuses to push if someone else has pushed since your last fetch, which prevents the classic overwritten-teammate-commit accident that a bare --force causes. The tool is a reference rather than a parser, so it will not read a git log or a diff; it works from your search terms alone.

Targeted Use Cases

  • Undoing the last commit without losing work, choosing between soft and mixed reset.
  • Recovering from a bad merge by finding the revert and rebase cards quickly.
  • Pausing half-finished work with stash before switching branches.
  • Looking up the safe force-push syntax before cleaning up a pushed feature branch.

Notes & Gotchas

  • Prefer revert over reset for any commit that is already on a shared branch; rewriting pushed history strands your teammates.
  • Read the danger notes on cards before copying; some commands, like reset --hard plus clean, discard work permanently.
  • Use push --force-with-lease instead of --force whenever the branch might have new remote commits.
  • Search by outcome, not by command name; undo commit finds more relevant cards than typing reset.

Frequently Asked Questions

Does this tool run git commands for me?

No. It is a searchable reference. It shows you the right command and copies it to your clipboard, but execution happens in your own terminal, which is the safe arrangement for destructive operations.

What is the difference between reset --soft, reset, and reset --hard?

Soft keeps your changes staged, mixed (the default) keeps them in the working directory but unstaged, and hard deletes the changes entirely. The cards in Undo & Fix Commits show all three with these outcomes described.

Why does the tool suggest push --force-with-lease?

Because it fails if someone else pushed to the branch after your last fetch, preventing you from overwriting their commits. A bare --force overwrites unconditionally, which is how teammates lose work.

Can I search for a specific error message?

Search matches card names, command text, and descriptions. If your error names a command or operation, searching that word usually finds the right card; free-form error text itself is not indexed.