Git Command Helper
Visual guide for modern Git workflows. Copy-paste sequences for branching, syncing, and repairing.
Initialize & First Commit
basicStart a new repository and push to a remote origin.
Interactive Rebase (Cleanup)
branchingSquash or edit the last N commits before pushing.
Undo Last Commit (Keep Files)
repairOops! I committed to the wrong branch or need to edit files.
Discard All Local Changes
repairReset the working directory to the last commit strictly.
Sync Fork with Upstream
remoteUpdate your fork with the latest changes from the original repo.
Handle with Care
Commands involving --force or reset --hard will permanently overwrite data. Always ensure your workspace is backed up or changes are stashed before executing destructive operations.
How to Use Git Command Helper
- 1
Search or Browse Commands
Use the search box to find a specific command, or browse by category.
- 2
Copy the Command
Click the Copy button next to any command to copy it to your clipboard.
- 3
Use in Your Terminal
Paste the copied command directly into your terminal.
Frequently Asked Questions
- What is git rebase vs git merge?
- Both integrate changes from one branch into another. Merge creates a merge commit preserving history. Rebase rewrites history for a linear commit graph.
- How do I undo the last commit without losing changes?
- Use: git reset --soft HEAD~1 — this undoes the commit but keeps your changes staged.