Setup · beginner
git config --global user.name "Your Name"
Set commit-author display name.
Example: git config --global user.name "Your Name"
Search practical Git commands, explore the four-stage workflow and generate conservative copyable commands.
42 commands
Setup · beginner
git config --global user.name "Your Name"
Set commit-author display name.
Example: git config --global user.name "Your Name"
Setup · beginner
git config --global user.email "[email protected]"
Set commit-author email.
Example: git config --global user.email "[email protected]"
Setup · beginner
git config --list --show-origin
Inspect configuration and its source.
Example: git config --list --show-origin
Repository · beginner
git init
Initialize a repository in the current directory.
Example: git init
Repository · beginner
git clone <url>
Create a local copy of a remote repository.
Example: git clone https://example.com/team/project.git
Repository · beginner
git status
Inspect branch, staged and working-tree changes.
Example: git status
Changes · beginner
git diff
Review unstaged changes.
Example: git diff
Changes · beginner
git diff --staged
Review changes prepared for the next commit.
Example: git diff --staged
Changes · beginner
git add -- <path>
Stage a literal path for the next commit.
Example: git add -- 'src/app.js'
Changes · beginner
git restore --staged -- <path>
Unstage a path while retaining working changes.
Example: git restore --staged -- 'src/app.js'
Commits · beginner
git commit -m <message>
Record staged changes with a descriptive message.
Example: git commit -m 'Add login form'
Commits · beginner
git log --oneline --decorate -n 10
Read recent commit history.
Example: git log --oneline --decorate -n 10
Commits · beginner
git show <commit>
Inspect a commit and its patch.
Example: git show HEAD
Commits · advanced
git commit --amend
Replace the latest local commit.
Example: git commit --amend
Rewrites the latest commit; coordinate before changing published history.
Branches · beginner
git branch --list
List local branches.
Example: git branch --list
Branches · beginner
git switch -c <branch>
Create and switch to a new branch.
Example: git switch -c feature/login
Branches · beginner
git switch <branch>
Switch an existing branch.
Example: git switch main
Branches · advanced
git branch -d <branch>
Delete a merged local branch.
Example: git branch -d feature/login
Deletes a local branch reference; inspect merged status and recovery options first.
Remotes · beginner
git remote -v
List configured remote addresses.
Example: git remote -v
Remotes · beginner
git fetch origin
Update remote-tracking references without merging.
Example: git fetch origin
Remotes · beginner
git push origin <branch>
Publish a named branch without a force flag.
Example: git push origin feature/login
Remotes · beginner
git pull --ff-only
Integrate only when a fast-forward is possible.
Example: git pull --ff-only
Merge/Rebase · beginner
git merge <branch>
Merge another branch into the current branch.
Example: git merge feature/login
Merge/Rebase · advanced
git merge --abort
Attempt to abort an in-progress merge.
Example: git merge --abort
Uncommitted pre-merge edits may complicate restoration; keep a backup.
Merge/Rebase · advanced
git rebase <branch>
Replay local commits on another base.
Example: git rebase main
Rewrites commit identities; avoid rewriting shared history without coordination.
Merge/Rebase · advanced
git rebase --continue
Continue after resolving and staging rebase conflicts.
Example: git rebase --continue
Merge/Rebase · advanced
git rebase --abort
Attempt to return to the pre-rebase state.
Example: git rebase --abort
Stash · beginner
git stash push -m <message>
Temporarily save tracked working changes.
Example: git stash push -m 'WIP login'
Stash · beginner
git stash list
List saved stashes.
Example: git stash list
Stash · advanced
git stash show -p stash@{0}Inspect a stash patch.
Example: git stash show -p stash@{0}
Stash · advanced
git stash apply stash@{0}Apply a stash without automatically dropping it.
Example: git stash apply stash@{0}
Application can conflict; inspect status and keep the stash until verified.
Tags · beginner
git tag --list
List local tags.
Example: git tag --list
Tags · advanced
git tag -a <tag> -m <message>
Create an annotated tag.
Example: git tag -a v1.0.0 -m 'Release 1.0'
Tags · beginner
git show <tag>
Inspect a tag and referenced commit.
Example: git show v1.0.0
Undo/Recovery · advanced
git revert <commit>
Create a new commit reversing an earlier change.
Example: git revert abc1234
Reverts can conflict; inspect the selected commit and shared-history implications.
Undo/Recovery · advanced
git reflog
Inspect recent local reference movements.
Example: git reflog
Undo/Recovery · advanced
git restore -- <path>
Discard unstaged edits to a tracked path.
Example: git restore -- 'src/app.js'
DESTRUCTIVE: unstaged edits can be permanently lost; copy them elsewhere first.
Undo/Recovery · advanced
git reset --hard <commit>
Reset tracked files and index to a commit.
Example: git reset --hard <commit>
DESTRUCTIVE: discards tracked uncommitted changes and moves the branch; recovery is not guaranteed.
Troubleshooting · beginner
git status --short --branch
Summarize repository state during troubleshooting.
Example: git status --short --branch
Troubleshooting · advanced
git log --graph --oneline --all -n 20
Inspect divergent histories.
Example: git log --graph --oneline --all -n 20
Troubleshooting · beginner
git diff --check
Check patches for whitespace problems.
Example: git diff --check
Troubleshooting · advanced
git ls-files --others --exclude-standard
Inspect untracked, nonignored files.
Example: git ls-files --others --exclude-standard
Your editable files. Inspect git status and git diff; git add prepares selected changes.
Generated command appears here.
Use git diff --staged to inspect. git restore --staged -- path removes it from the index while keeping working changes.
Check the intended directory and repository location; this page never inspects it for you.
Fetch and inspect both histories before selecting a merge/rebase workflow; do not force-push blindly.
Inspect status, resolve each conflict in the files, stage the resolution and continue the intended operation.
Inspect the current commit; create a named branch if you intend to retain new commits.
Back up and inspect untracked files before switching or merging; do not delete them blindly.
Reference and command generation only; this tool never executes Git or inspects a repository. Destructive and history-rewriting commands carry contextual warnings. Generated arguments deliberately support a conservative character subset; quoting examples use POSIX-style shells.
Processing uses your browser memory. Inputs are not included in page analytics. Text tools accept up to 200,000 UTF-8 bytes unless a tighter limit is stated. Worker operations time out after 45 seconds and can be cancelled. Clipboard and downloads require an explicit action.
Enter your values locally; no inputs are uploaded.
Check validation feedback before reviewing the browser-generated result.
Review the explanation, copy supported outputs or reset the workspace.
No. It is a searchable reference and text-only command generator. Copying a command does not run it, inspect a repository or change Git configuration.
Reference and command generation only; this tool never executes Git or inspects a repository. Destructive and history-rewriting commands carry contextual warnings. Generated arguments deliberately support a conservative character subset; quoting examples use POSIX-style shells.
Processing takes place locally in browser memory. Inputs are not sent to a processing service, persisted by this tool or included in analytics. Ordinary page requests may still be logged. Clipboard and downloads require explicit actions.
No. It is a searchable reference and text-only command generator. Copying a command does not run it, inspect a repository or change Git configuration.
Working directory contains edits, staging/index defines the next snapshot, the local repository stores commits, and the remote stores published references. Selecting each stage explains the relevant inspection and transfer commands.
It deliberately permits a conservative ASCII subset and rejects controls, shell metacharacters, dot components, double dots and .lock endings. This avoids generating ambiguous shell text, at the cost of excluding some otherwise valid Git names.
Generated paths and commit messages use POSIX-style single quotes and a conservative character subset. Adapt examples for the actual shell and inspect all arguments before independently running them.
Commands that discard edits or rewrite history have explicit contextual warnings in advanced reference cards. The recovery helper emphasizes inspecting diffs, backups, reference history and collaboration before selecting a remedy.
No. It generates a normal push using a conservative remote alias and named branch. Diverged-history guidance recommends fetching, inspecting both histories and selecting a coordinated merge/rebase policy.