🛠️ ToolsPilot
📐

Git Command Cheat Sheet

Quick reference for common Git commands. Free, no signup.

Setup

git init

Initialize a new Git repository

git clone <url>

Clone a repository

git config user.name "name"

Set username

git config user.email "email"

Set email

Staging

git add .

Stage all changes

git add <file>

Stage a specific file

git reset <file>

Unstage a file

Status

git status

Show working tree status

git diff

Show unstaged changes

git diff --staged

Show staged changes

Commit

git commit -m "msg"

Commit staged changes with message

git commit --amend

Amend the last commit

Log

git log --oneline

Show compact commit history

git log --graph --oneline

Show branching history

git log -p

Show commit history with diffs

Branch

git branch

List local branches

git branch <name>

Create a new branch

git checkout <branch>

Switch to a branch

git checkout -b <name>

Create and switch to new branch

git merge <branch>

Merge a branch into current

git branch -d <name>

Delete a branch

git rebase <branch>

Rebase current branch onto another

Remote

git fetch

Fetch remote changes

git pull

Fetch and merge remote changes

git push

Push local commits to remote

git push -u origin <branch>

Push and set upstream

git remote -v

List remote repositories

Stash

git stash

Stash current changes

git stash pop

Apply and remove last stash

git stash list

List all stashes

git stash drop

Delete last stash

Advanced

git cherry-pick <hash>

Apply a specific commit

git reset --soft HEAD~1

Undo last commit, keep changes

git reset --hard HEAD~1

Undo last commit, discard changes

git revert <hash>

Create a commit that undoes changes

git tag <name>

Create a lightweight tag

git clean -fd

Remove untracked files and dirs

git blame <file>

Show who changed each line

🎉 100% Free. Quick reference for all Git commands.