ToolPal

Git Command Generator

A comprehensive git command reference and generator. Filter by category, search by what you want to do, fill in parameters, and copy the ready-to-run command.

git init

Initialize a new Git repository in the current directory.

basic
git clone <url>

Clone a remote repository into a new local directory.

basic
git status

Show the working tree status — staged, unstaged, and untracked files.

basic
git add .

Stage all changed and new files in the current directory.

basic
git add <file>

Stage a specific file for the next commit.

basic
git commit -m "<message>"

Create a new commit with a message describing the changes.

basic
git log --oneline

Display the commit history in a compact one-line format.

basic
git diff

Show unstaged changes between your working tree and the index.

basic
git diff --staged

Show changes between the index (staged) and the last commit.

basic
git branch

List all local branches. The current branch is marked with an asterisk.

branching
git branch <branch>

Create a new branch without switching to it.

branching
git checkout <branch>

Switch to an existing branch.

branching
git checkout -b <branch>

Create a new branch and switch to it immediately.

branching
git switch -c <branch>

Create and switch to a new branch (modern alternative to checkout -b).

branching
git merge <branch>

Merge the specified branch into the current branch.

branching
git rebase <branch>

Reapply commits on top of another branch, creating a linear history.

branching
git branch -d <branch>

Delete a local branch (safe — only if fully merged).

branching
git tag <name>

Create a lightweight tag at the current commit.

branching
git remote add origin <url>

Add a remote named 'origin' pointing to the given URL.

remote
git remote -v

List all configured remotes with their fetch and push URLs.

remote
git fetch origin

Download objects and refs from the remote without merging.

remote
git pull origin <branch>

Fetch and integrate changes from the remote branch.

remote
git push origin <branch>

Push the local branch to the remote repository.

remote
git push -u origin <branch>

Push and set the upstream tracking so future pushes only need 'git push'.

remote
git cherry-pick <commit>

Apply the changes introduced by a specific commit onto the current branch.

remote
git reset --soft HEAD~1

Undo the last commit but keep changes staged.

undo
git reset HEAD~1

Undo the last commit and unstage changes (default mixed mode).

undo
git reset --hard HEAD~1

Undo the last commit and discard all changes permanently.

undo
git revert <commit>

Create a new commit that undoes the changes from a specific commit.

undo
git restore <file>

Discard changes in the working tree for a specific file.

undo
git restore --staged <file>

Unstage a file while keeping the working tree changes.

undo
git commit --amend -m "<message>"

Modify the most recent commit message (before pushing).

undo
git stash

Temporarily save uncommitted changes to the stash stack.

stash
git stash push -m "<message>"

Stash changes with a descriptive message.

stash
git stash list

List all stashed changesets.

stash
git stash pop

Apply the most recent stash and remove it from the stash stack.

stash
git stash apply stash@{<index>}

Apply a specific stash entry without removing it from the stack.

stash
git stash drop stash@{<index>}

Remove a specific stash entry from the stash list.

stash
git log --oneline --graph --all

Display a visual ASCII graph of the branch history.

advanced
git bisect start

Begin a binary search to find the commit that introduced a bug.

advanced
git blame <file>

Show what revision and author last modified each line of a file.

advanced
git reflog

Show a log of all HEAD movements — useful for recovering lost commits.

advanced
git clean -fd

Remove untracked files and directories from the working tree.

advanced
git submodule add <url> <path>

Add another repository as a submodule at the given path.

advanced
git worktree add <path> <branch>

Check out a branch into a new working tree directory.

advanced

How to Use

A comprehensive git command reference and generator. Filter by category, search by what you want to do, fill in parameters, and copy the ready-to-run command.

  1. 1Use the category tabs at the top to filter commands — choose Basic, Branching, Remote, Undo, Stash, or Advanced, or keep 'All' to see everything.
  2. 2Type in the search box to filter by command name or description. For example, type 'merge' or 'undo commit' to find relevant commands quickly.
  3. 3Find the command you need. Each card shows the full command syntax, a description, and a category badge.
  4. 4If the command has parameters (like <branch> or <message>), fill in the text inputs on the card — the command updates in real time.
  5. 5Click the 'Copy' button on the card to copy the ready-to-run command to your clipboard, then paste it into your terminal.

Key Features

  • 45+ git commands — covering Basic, Branching, Remote, Undo, Stash, and Advanced categories
  • Live parameter substitution — fill in branch names, file paths, or commit hashes and copy a ready-to-run command
  • Full-text search — find commands by name or description, not just syntax
  • Category filtering — focus on just the commands relevant to your current task
  • No installation required — runs entirely in your browser, works as a quick reference even without internet

Frequently Asked Questions

Learn More