Skip to content

Git Cheatsheet

Common git commands organized by category. Click to copy any command.

Getting Started

git initCopy
git clone <url>Copy
git clone <url> <dir>Copy
git config --global user.name "name"Copy
git config --global user.email "email"Copy

Staging & Committing

git statusCopy
git add <file>Copy
git add .Copy
git add -pCopy
git commit -m "msg"Copy
git commit -am "msg"Copy
git commit --amendCopy
git diffCopy
git diff --stagedCopy

Branching

git branchCopy
git branch -aCopy
git branch <name>Copy
git checkout <branch>Copy
git checkout -b <branch>Copy
git switch <branch>Copy
git switch -c <branch>Copy
git branch -d <branch>Copy
git branch -D <branch>Copy
git branch -m <new>Copy

Merging & Rebasing

git merge <branch>Copy
git merge --no-ff <branch>Copy
git rebase <branch>Copy
git rebase -i HEAD~3Copy
git rebase --abortCopy
git rebase --continueCopy
git cherry-pick <commit>Copy

Remote

git remote -vCopy
git remote add origin <url>Copy
git fetchCopy
git fetch --pruneCopy
git pullCopy
git pull --rebaseCopy
git pushCopy
git push -u origin <branch>Copy
git push --forceCopy
git push origin --delete <branch>Copy

Undoing Changes

git restore <file>Copy
git restore --staged <file>Copy
git reset HEAD~1Copy
git reset --hard HEAD~1Copy
git reset --hard <commit>Copy
git revert <commit>Copy
git checkout -- <file>Copy

Logging & History

git logCopy
git log --onelineCopy
git log --graph --onelineCopy
git log -n 5Copy
git log --author="name"Copy
git log --since="2 weeks ago"Copy
git blame <file>Copy
git show <commit>Copy
git shortlog -snCopy

Stashing

git stashCopy
git stash push -m "msg"Copy
git stash listCopy
git stash popCopy
git stash applyCopy
git stash apply stash@{2}Copy
git stash drop stash@{0}Copy
git stash clearCopy
git stash show -pCopy

Tags

git tagCopy
git tag <name>Copy
git tag -a <name> -m "msg"Copy
git push origin <tag>Copy
git push origin --tagsCopy
git tag -d <name>Copy

Advanced

git bisect startCopy
git bisect good <commit>Copy
git bisect bad <commit>Copy
git reflogCopy
git clean -fdCopy
git worktree add <path> <branch>Copy
git submodule update --initCopy

How to Use Git Cheatsheet

  1. Paste your code or data into the input field
  2. Choose the operation you want to perform
  3. View the formatted, validated, or transformed output
  4. Copy the result or download if available

Why Use Git Cheatsheet?

Developer tools on FreeTools.one are designed to replace the dozen browser tabs you'd otherwise need. JSON formatting, regex testing, JWT decoding, SQL formatting, diff checking — everything runs in your browser with zero configuration. There's nothing to install, no CLI to learn, no Docker containers to spin up. Each tool provides professional-grade output with syntax highlighting, error detection, and one-click copy. Your code and data never leave your device because all processing happens client-side. These tools are built by developers, for developers, with the exact features you need: customizable indentation, multiple output formats, real-time validation, and keyboard shortcuts. They're fast enough for quick checks during coding sessions and powerful enough for production data transformation.

  • No installation needed — works directly in your browser
  • Client-side processing keeps your code private
  • Professional-grade formatting and validation
  • Save hours of manual coding and debugging

Frequently Asked Questions

Is my code sent to a server?

No. All processing happens in your browser. Your code never leaves your device.

Does it support syntax highlighting?

Yes. Output is displayed with proper formatting for easy reading.

Can I use this for production code?

Absolutely. The output is clean and ready for production use.

Related Tools You Might Like