Git Command Builder

Live

Git Command Builder turns a Git task into the exact commands to run.

Runs in your browser: what you enter is processed on your device and not uploaded to MyToolDock.

What is Git Command Builder?

Git Command Builder turns a Git task into the exact commands to run. It builds commands; it does not run them or look at your repository, so check the branch and commit names first. Messages and names are quoted for the shell you choose.

How It Works

  1. Enter the task you want and the names, hashes or messages it needs in the input fields on this page.
  2. Press the button to run Git Command Builder.
  3. Read one or more Git commands, with a note on whether they rewrite history or discard work in the result area, and copy or download it.

Common Uses

Good to Know

Look at the label above the command. Anything marked Rewrites history needs care on a branch other people use, and anything marked Discards work cannot be easily undone.

How it works

Choose what you want to do, such as undo the last commit, squash commits, rename a branch or delete a remote branch. Fill in the few fields shown and the exact commands appear, with a note on what each one does. Choose bash, PowerShell or cmd so the quoting is right for your shell.

Each task carries a label: Safe, Rewrites history, or Discards work. Read it before you run anything.

Worked example

Commands from the tasks were run in a real Git repository and the results checked. Undo-soft kept the changes staged, undo-mixed left them in the working folder, and undo-hard removed them. Squashing three commits reduced the commit count by two and used the new message. A commit message containing an apostrophe and quotes was stored exactly as typed. A branch with unmerged work was refused by git branch -d and removed by -D.

Limits

It builds commands from fixed templates and does not read your repository. Branch names and hashes are checked, and unsafe input is rejected. Rewriting history needs a force push, and that affects everyone who shares the branch. Interactive rebase opens your editor.

Frequently Asked Questions

Is it safe to run the commands?

Check the label first. Commands marked Rewrites history or Discards work can lose commits or changes.

Why is force-with-lease used instead of force?

It refuses to overwrite commits on the remote that you have not seen, which is safer.

Does it connect to my repository?

No. It only writes text for you to copy.

What does Git Command Builder do?

Git Command Builder turns a Git task into the exact commands to run. It builds commands; it does not run them or look at your repository, so check the branch and commit names first. Messages and names are quoted for the shell you choose.

What do I need to enter in Git Command Builder?

The task you want and the names, hashes or messages it needs.

Is my data private in Git Command Builder?

Nothing you enter leaves your browser.

Is MyToolDock Git Command Builder free to use?

Yes, MyToolDock Git Command Builder is 100% free with no registration, subscriptions, or limits. All features are fully unlocked.

Related Tools

.env and .properties to JSON Converter .env File Validator Ascii85 Encoder and Decoder Base32 Encoder and Decoder Epoch to Human Date Gitignore Generator

More Developer Tools guides

More in Developer Tools · Browse all tools

Developer Scratchpad

Copied to clipboard!