Dev Patrache

Git Spiekbriefje

Setup

Safe
git config --global user.name "Name"

Set user name

git config --global user.name "Sam"

Safe
git config --global user.email "email"

Set email

git config --global user.email "[email protected]"

Safe
git config --list

Show all config

git config --list

Start

Safe
git init

Initialize a new repository

git init my-project

Safe
git clone <url>

Clone a remote repository

git clone https://github.com/user/repo.git

Changes

Safe
git status

Working directory status

git status

Safe
git diff

Compare changes

git diff HEAD~1

Safe
git add <file>

Add to staging

git add . / git add file.txt

Safe
git commit -m "message"

Create a commit

git commit -m "feat: new feature"

Caution
git commit --amend

Amend the last commit

git commit --amend -m "updated message"

Safe
git stash

Temporarily stash changes

git stash / git stash pop

Branch

Safe
git branch

List branches

git branch -a

Safe
git branch <name>

Create a new branch

git branch feature/login

Safe
git checkout <branch>

Switch branch

git checkout main

Safe
git checkout -b <name>

Create and switch

git checkout -b feature/login

Caution
git merge <branch>

Merge a branch

git merge feature/login

Caution
git branch -d <name>

Delete a branch

git branch -d feature/login

Danger
git branch -D <name>

Force-delete a branch

git branch -D feature/login

Remote

Safe
git remote -v

List remotes

git remote -v

Safe
git fetch

Fetch remote changes

git fetch origin

Caution
git pull

Fetch and merge

git pull origin main

Caution
git push

Push to remote

git push origin main

Danger
git push --force

Force push

git push --force origin main

Undo

Caution
git restore <file>

Discard file changes

git restore file.txt

Safe
git reset HEAD <file>

Unstage a file

git reset HEAD file.txt

Safe
git revert <commit>

Revert a commit (new commit)

git revert abc123

Caution
git reset --soft HEAD~1

Undo last commit (keep changes)

git reset --soft HEAD~1

Danger
git reset --hard HEAD~1

Delete last commit (discard changes)

git reset --hard HEAD~1

Inspect

Safe
git log

Commit history

git log --oneline --graph

Safe
git log --oneline

One-line history

git log --oneline -10

Safe
git show <commit>

Commit details

git show abc123

Safe
git blame <file>

Per-line author

git blame file.txt

Safe
git reflog

HEAD history (for recovery)

git reflog

Laatst bijgewerkt: 2026 · Gratis online tool

Wat is Git Spiekbriefje?

Gratis Git-cheatsheet met doorzoekbare commando's per categorie, van branchen en mergen tot rebase, stash en reset, elk met gebruik en een gevaarniveau om fouten te voorkomen.

Gebruiksaanwijzing

  1. 1
    Categorie kiezen— Kies een categorie zoals Configuratie, Branch of Ongedaan maken.
  2. 2
    Zoeken— Zoek op commando of beschrijving.
  3. 3
    Gevaarniveau controleren— Rode commando's kunnen gegevensverlies veroorzaken — gebruik met voorzichtigheid.
  4. 4
    Kopiëren— Kopieer het gewenste commando en gebruik het in uw terminal.

Gerelateerde tools

Veelgestelde vragen

Meer dan 35 commando's in 7 categorieën: Configuratie, Init, Wijzigingen, Branch, Remote, Ongedaan maken en Weergave.

Veilig (groen) betekent geen gegevensverlies, Voorzichtig (geel) betekent oplettendheid vereist, Gevaar (rood) betekent mogelijk gegevensverlies.

Ja, gebruik de kopieerknop bij elk commando om het naar het klembord te kopiëren.

Ja, moderne commando's zoals git restore en git switch zijn inbegrepen.

Ja, alle gegevens zijn statisch opgenomen en werken offline.

Deze site gebruikt cookies voor een betere ervaring en advertenties. Meer informatie