A Git cheatsheet puts every essential command at your fingertips — from initializing a repository to resolving merge conflicts. Whether you are a beginner learning version control or an experienced developer who needs a quick syntax reminder, this interactive reference covers all major Git workflow stages with real examples and one-click copy buttons.
No commands found
Try a different search term or select a different section
How to Use This Git Cheatsheet
This interactive Git cheatsheet is designed to be your go-to reference for Git commands. Whether you are branching for the first time, recovering from a bad commit, or syncing with a remote, every command you need is organized by workflow stage and searchable in seconds.
Searching for Commands
Type any keyword into the search bar to instantly filter commands. You can search by command name (e.g., rebase), by description (e.g., "undo"), or by example text. Results update live as you type. Click Clear or delete the search text to return to the full list.
Filtering by Workflow Stage
Use the section filter buttons to focus on specific stages: Setup & Init covers configuring Git and creating repositories; Staging & Commits covers day-to-day file tracking; Branching covers creating, switching, and deleting branches; Merging & Rebasing covers integrating changes; Remote covers pushing and pulling; Stash covers temporarily shelving work; Log & Diff covers inspecting history; and Undo & Reset covers recovering from mistakes.
Copying Commands
Every command card has a Copy button. Click it to copy the command syntax to your clipboard, then paste it directly into your terminal. The button briefly shows "Copied!" to confirm. The syntax shown uses angle brackets like <branch> as placeholders — replace those with your actual values.
Understanding the Command Cards
Each card shows the command syntax in monospace, a short description explaining what it does, and a real-world example so you can see the command in action. Common flags and options are shown in the syntax where relevant. Dangerous commands (like force push or hard reset) are clearly labeled so you can proceed with caution.
Common Git Workflows
Most daily Git work follows a few core patterns: create a branch, make commits, push to remote, and open a pull request. For hotfixes, you typically branch off main, fix the bug, and merge back. For complex feature work, rebasing onto the latest main before merging keeps history clean. This Git commands reference covers every step of these workflows so you can find exactly what you need without leaving your browser.
Frequently Asked Questions
Is this Git cheatsheet free to use?
Yes, this Git cheatsheet is completely free with no signup, account, or payment required. All commands are available instantly in your browser.
Is my data safe when using this tool?
Absolutely. This cheatsheet runs entirely in your browser — no data is sent to any server. Your searches and usage are completely private.
What Git commands are covered in this cheatsheet?
The cheatsheet covers all major Git workflow stages: initializing repositories, staging and committing, branching and merging, working with remotes, stashing changes, viewing log and history, and undoing changes. Over 60 essential commands are included.
How do I search for a specific Git command?
Use the search bar at the top of the cheatsheet. You can search by command name, description, or example. Results update instantly as you type. You can also filter by workflow section using the category buttons.
How do I copy a Git command from the cheatsheet?
Every command card has a copy button on the right side. Click it to instantly copy the command syntax to your clipboard. The button briefly shows 'Copied!' to confirm the action.
What is the difference between git merge and git rebase?
Both commands integrate changes from one branch into another, but they do it differently. Merge creates a new commit that joins two branches, preserving the complete history. Rebase moves commits from one branch onto another, creating a cleaner linear history but rewriting commit SHAs. Use merge for shared branches and rebase for local cleanup before merging.
What is git stash used for?
Git stash temporarily shelves changes you have made to your working copy so you can switch to another task. When you are ready to continue your previous work, you can restore the saved changes with git stash pop. It is useful when you need to quickly switch context without committing incomplete work.
How do I undo the last git commit without losing my changes?
Use git reset HEAD~1 to undo the last commit while keeping your changes staged. If you want to unstage the changes too, use git reset HEAD~1 --mixed. To keep changes only in your working directory (unstaged), use --mixed (the default). Never use git reset --hard on commits that have already been pushed, as this rewrites history.