Git Cheatsheet

What is a Git Cheatsheet?

Comprehensive interactive reference guide for essential Git version control commands. Quickly lookup syntax for repository initialization, branching, merging, rebasing, stashing, log filtering, remote tracking, and undoing changes.

Why Use This Tool?

  • Fast Syntax Lookup: Quickly copy exact Git CLI commands for tricky operations like interactive rebase or hard resets.
  • Branch & Merge Workflows: Reference best-practice commands for feature branching, squashing commits, and resolving merge conflicts.
  • Undoing Changes Safely: Reference exact commands to discard local uncommitted changes, unstage files, or revert commits.

How to Use

  1. Search or select a Git task category (e.g. Branching, Stashing, Undoing Changes).
  2. Click on any Git command block.
  3. Copy the command to your terminal clipboard with one click.

Real Working Example

Input:

Task: Revert last commit while keeping changes staged

Output Result:

Git Command: git reset --soft HEAD~1

Important Technical Details & Specifications

  • Categorized CLI Reference: Covers Setup, Working Tree, Staging, Committing, Branching, Remote Sync, Inspection, and Recovery.
  • Interactive Search & Filter: Instantly filter Git commands by keyword (e.g. `rebase`, `stash`, `cherry-pick`).
  • 100% Offline Access: Cheatsheet data is stored locally in browser memory.

Related Developer Tools

Frequently Asked Questions

How do I undo the last Git commit without losing my code changes?

Use `git reset --soft HEAD~1` to undo the commit while leaving your files modified and staged.

What is the difference between git merge and git rebase?

`git merge` creates a merge commit joining two branch histories; `git rebase` rewrites history by applying your branch commits on top of another branch.

How do I save temporary uncommitted changes without committing?

Use `git stash` to save uncommitted work to a temporary stack, and `git stash pop` to restore it later.

Is it free?

Yes, 100% free.

How do I change the last commit message?

Use `git commit --amend -m "New commit message"` to update the previous commit message.

How do I delete a local and remote Git branch?

Delete local branch with `git branch -d branch_name`; delete remote with `git push origin --delete branch_name`.