Git Command Generator
Find and copy Git commands for any task. Search by action, browse by category.
git initCreate a new Git repository in the current directory.
git clone <url>Clone a remote repository to your local machine.
git config --global user.name "Your Name"Set your Git username globally.
git config --global user.email "you@example.com"Set your Git email globally.
git statusShow the working tree status (modified, staged, untracked files).
git add -AStage all changes (new, modified, deleted) for the next commit.
git add <file>Stage a specific file for commit.
git commit -m "message"Record staged changes with a descriptive message.
git commit -am "message"Stage and commit all tracked file changes in one step.
git log --oneline --graphShow commit history as a compact graph.
git diffShow unstaged changes in your working directory.
git branch -aList all local and remote branches.
git branch <name>Create a new branch from current HEAD.
git checkout <branch>Switch to an existing branch.
git checkout -b <branch>Create a new branch and switch to it.
git branch -d <branch>Delete a fully merged local branch. Use -D to force delete.
git branch -m <old> <new>Rename a branch.
git push origin <branch>Upload local commits to the remote.
git pull origin <branch>Fetch and merge remote changes.
git fetch --allDownload remote changes without merging.
git remote add origin <url>Link a local repo to a remote URL.
git push -u origin <branch>Push a new branch and set upstream tracking.
git push --force-with-leaseForce push safely (fails if remote has new commits).
git merge <branch>Merge another branch into the current branch.
git rebase <branch>Replay commits on top of another branch for a linear history.
git rebase -i HEAD~<n>Edit, squash, or reorder the last n commits.
git cherry-pick <hash>Apply a specific commit from another branch.
git merge --abortCancel an in-progress merge with conflicts.
git reset HEAD <file>Remove a file from staging (keep working changes).
git checkout -- <file>Discard all working directory changes for a file.
git reset --soft HEAD~1Undo last commit, keep changes staged.
git reset --hard HEAD~1Undo last commit and discard all changes (destructive).
git revert <hash>Create a new commit that undoes a previous commit.
git commit --amendEdit the last commit message or add more changes.
git stashSave uncommitted changes for later.
git stash popRestore the most recently stashed changes.
git stash listShow all saved stashes.
git stash dropDelete the most recent stash.
git tag v1.0.0Create a lightweight tag at current commit.
git tag -a v1.0.0 -m "Release 1.0"Create an annotated tag with a message.
git push --tagsPush all local tags to the remote.
git tag -d v1.0.0Delete a local tag.
42 of 42 commands shown
Frequently Asked Questions
Related Tools
JSON Formatter
Format, validate, and minify JSON data with syntax highlighting.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings back to plain text.
Regex Tester
Test and debug regular expressions in real-time. Matches highlighted, capture groups, replacements.
CSV to JSON Converter
Convert CSV data to JSON arrays and JSON arrays back to CSV. Custom delimiters supported.
Text Diff Checker
Compare two texts and see additions, removals, and unchanged lines highlighted side by side.
Image to Base64 Converter
Convert images to Base64 encoded strings and data URIs. Supports PNG, JPEG, GIF, WebP, and SVG. No upload, fully private.