Skip to content
100% local

Git command builder

Turn a chosen git operation and a few fields into a ready-to-paste command, explained switch by switch.

Output

Git command builder

Pick an operation — undoing a commit, renaming a branch, an interactive rebase, a cherry-pick, a stash, cleaning a file out of history, or recovering a branch you deleted by mistake — fill in the branch name, commit hash or message it needs, and this tool assembles the exact git command line you would otherwise look up or try to reconstruct from memory. It suits the moment you know what you want to do but not the precise flags, and anyone who would rather check a generated command against a plain-language explanation than paste one from a half-remembered forum thread.

Every operation offers a safe variant and a destructive one. Safe favors commands that are local, reversible or fail rather than overwrite something — git revert instead of a hard reset, a plain rename instead of a forced push. Destructive does what its name says: it force-pushes, force-resets or rewrites history outright, and the tool prints a warning above the command explaining what becomes unrecoverable. Turn on "Explain each switch used" for a line-by-line reference of every flag — what -i, --hard, -X theirs, --force-with-lease or -u actually does.

Branch fields accept only characters git allows in a ref name; commit hashes take short or long hex refs; free-text fields like a stash message keep their own script. "Also generate a gitconfig alias" wraps the finished command as one git config --global alias.<name> line to paste in and reuse later.

Everything runs in your browser. No git command is executed and nothing you type is sent anywhere — the tool only assembles text. Copy the result, download it as a .txt file, or send it to another tool's input to keep working on it.

FAQ

What is the difference between the safe and destructive variant?
The safe variant favors reversible, local commands — git revert instead of a hard reset, a plain rename instead of a forced push. The destructive variant force-pushes, force-resets or rewrites history, and the tool prints a warning above the command explaining exactly what it discards or overwrites.
Does this tool run git commands for me?
No. It only builds the command text. You copy it and run it yourself in your own terminal, after reading the explanation and any warning.
Why does "clean up commit history" mention a separate tool called git filter-repo?
Git's own history-rewriting commands (filter-branch) are slow and easy to misuse; filter-repo is the tool the Git project itself now recommends for removing a file from every commit. It needs to be installed separately — the generated command assumes it is already on your PATH.
Can I turn the generated command into a reusable git alias?
Yes. Turn on "Also generate a gitconfig alias" and give it a name — the tool adds a git config --global alias.<name> line below the command that you can paste into your terminal once.
Is anything I type here uploaded anywhere?
No. Branch names, commit hashes and messages never leave your browser — the command is assembled entirely on your device.