Tool.Yun
Geliştiriciler için kullanışlı araçlar
ActiveDirectory LDAP özellik arayıcısı
DMARC Rapor Analizcisi
DNS Test Cihazı
DNS Yayılım Test Cihazı
Direnç Hesaplayıcısı
Dosya Türü Algılayıcı
E-posta Ayrıştırıcısı
EMV TLV kod çözücü
ETH İşlem Kod Çözücü
GZip/Deflate dönüştürücü
Geri Dönen E-posta Ayrıştırıcısı
HTTPS Test Cihazı
Hassas veri maskeleyici
Hex Kodlayıcı/Kod Çözücü
Kar Tanesi Kimlik Çıkarıcı
Kayan nokta sayı dönüştürücü
Keycode bilgisi
Kısa URL Genişletici
MIME Kodlama Dönüştürücü
Metin Karakter Seti Algılayıcı/Kod Çözücü
MongoDB ObjectId Dönüştürücü
Nmap Komut Oluşturucu
Orta-Endian Dönüştürücü
Outlook MSG Ayrıştırıcısı
Outlook Safelink kod çözücü
Parke dosyaları Okuyucu
RJ45 Cat6 Kablolama Hızlı Referans Kılavuzu
SMART Raw Dönüştürücü
Seri Port Konsolu
SharePoint Paylaşım URL Kod Çözücü
TCPDump Oluşturucu
URL Oluşturucu
URL ayrıştırıcısı
Çerez Ayrıştırıcısı
Ölü Piksel Test Cihazı
键盘测试器
ARPA Kod Çözücü
Apache LogRotate Oluşturucu
BIMI DNS Oluşturucu
Chmod hesaplayıcısı
Cloudflare DNS/RDAP Sorguları
Crontab oluşturucu
Curl Komut Üreticisi
DKIM DNS Oluşturucu
DMARC DNS Oluşturucu
DNS Sorguları
DNSBL Denetleyicisi
FStab Jeneratörü
Görsel Alt Ağ Hesaplayıcı
HAS Dezenfektan
HDD hesaplayıcısı
HTAccess oluşturucu
Htpasswd/htaccess üreteci
IP Adresim
IP Alt Ağları Hariç Tutma Hesaplayıcısı
IP Coğrafi Konum
IPv4 Alt Ağ Listeleyicisi
IPv4 adres dönüştürücü
IPv4 alt ağ hesaplayıcısı
IPv4 aralık genişletici
IPv4-6/IPRange/CIDR, IPRange/CIDR/IPMask'ta
IPv4/6 Aralığı CIDR(ler) Hesaplayıcısı
IPv6 ULA üreteci
IPv6 adres dönüştürücü
IPv6 alt ağ hesaplayıcısı
Iptables Üreticisi
Ipv4/6 CIDR - IP Aralığı Hesaplayıcısı
Kabuk Komutları Biçimlendiricisi
Kabuk Komutları Doğrusallaştırıcı
Kapatma Komutu Oluşturucu
MAC Adresi Dönüştürücü
MAC adresi araması
MAC adresi üreteci
Mikrofon Test Cihazı
Nginx biçimlendirici
Option43 jeneratörü
PTR DNS Oluşturucu
Ping
Port Numaraları
Punycode Dönüştürücü
RAID Güvenilirlik Hesaplayıcısı
RAID Hesaplayıcı
Rastgele port oluşturucu
Rsync Üreticisi
SIP Yetkilendirmesi
SPF DNS oluşturucu
TCP/UDP Port Test Cihazı
Tam Sayılardan IPv4/IPv6'ya
Temel kimlik doğrulama oluşturucu
UFW Komut Üreticisi
Veri Aktarım Hızı Hesaplayıcı
WPA PSK üreteci
Websocket testi
Whois Denetleyicisi
Wireguard Yapılandırma Oluşturucu
X-VR-SpamCause Kod Çözücü
ZPOOL RAID hesaplayıcısı
ZPool Hile Sayfası
Zxcvbn Şifre Gücü
firewalld komut satırı oluşturucu
tools.restic-command-generator.name
tools.url-redirection-checker.name
Çoklu bağlantı indirici
Şifre gücü analizi
Barkod Okuyucu
Barkod üreteci
GTIN Doğrulayıcı
QR Kod çözücü
QR Kod üreteci
QR İletişim Bilgisi Oluşturucu
WiFi QR Kodu üreteci
tools.epc-qrcode-generator.name
AGE Kriptografisi
Ansible Vault şifreleme şifresini çözme
Argon2 Karıştırıcı
Bcrypt
Bech32 Kodlayıcı/Kod Çözücü
CRC hesaplayıcısı
CSR Üreticisi
Dosya Karıştırıcı
ECDSA anahtar çifti oluşturucu
Ed25519 anahtar çifti üreteci
Hmac oluşturucu
JWT Jeneratörü
JWT ayrıştırıcısı
Jasypt Dize Şifrelemesi
Karma metin
Metni Şifrele/Çöz
Niceware Baytlarını Parolaya Dönüştürme
PGP Dosya Şifrelemesi
PGP anahtar üreticisi
PGP şifrelemesi
Paseto/PASERK Kamu/Özel
Paseto/PASERK Yerel
RSA anahtar çifti üreteci
RSA şifrelemesi
RSA/DSA/ECDSA İmzalayan ve Doğrulayan
SAML Ayrıştırıcısı
SSL Sertifika dönüştürücü
Sertifika/Anahtar ayrıştırıcısı
Shamir'in Gizli Paylaşımı
X509 sertifika oluşturucu
Base64 Hex dizi kodlayıcı/kod çözücü
Base64 dosya dönüştürücü
Base64 metin şifreleyici/çözücü
CSV'den Veriye
Coğrafi Koordinat Dönüştürücü
E-posta normalleştirici
Enerji Tüketimi ve Gider Bilgisayarı
Excel'den veriye
Metinden UTF-8 ikilisine
Metinden Unicode'a
Roma rakamı dönüştürücü
Tam sayı taban dönüştürücü
Torrent'ten Mıknatısa
ULID üreteci
Unicode Karakterlerini Java Varlıklarına Dönüştürücü
Veri Depolama Birimi dönüştürücü
dBm mW Dönüştürücü
Çevre Değişkenleri Biçim Dönüştürücü
Çok Birim Dönüştürücü
Özellikler dönüştürücü
Amortisman Hesaplayıcısı
Alan Birimleri Dönüştürücü
Aydınlatma Dönüştürücü
Açı Birimleri Dönüştürücü
Basınç Birimleri Dönüştürücü
Enerji Birimleri Dönüştürücü
Fitness Bilgisayarı
Frekans Dönüştürücü
Güç Dönüştürücü
Gıda Enerji Dönüştürücü
Hacim Akış Hızı Dönüştürücü
Hacim Birimleri Dönüştürücü
Hız Dönüştürücü
Hızlanma Dönüştürücü
Kuvvet Birimleri Dönüştürücü
Kütle Birimleri Dönüştürücü
SI Önekleri Dönüştürücü
Sıcaklık dönüştürücü
Uzunluk Birimleri Dönüştürücü
ANSI Kaçış Test Cihazı
API Testleri
Açık grafik meta üreteci
Bukle Dönüştürücü
CSS/JS Güzelleştirme ve Küçültme
Cli komut düzenleyicisi
Django Gizli Üreticisi
Dosya Bölücü
Favicon Oluşturucu
GitIgnore Oluşturucu
Gitattributes Generator
HEX Dosya Dönüştürücü
Javascript Gizleyici
Javascript Güzelleştirici
Javascript Unobfuscator/Unpacker
Json'dan Protobuf'a
Json'dan SQL'e INSERT
Json'dan Typescript'e
K6 Yük Testi Komut Dosyası Oluşturucu
Kod/Komut Dosyası Vurgulayıcı
Mailto Oluşturucu
Picomatch Test Cihazı
Pomodoro Zamanlayıcısı
SQL Küçültücü
SQL Parametreleri Oluşturucu
SQL güzelleştirici
Stacktrace daha güzel
Swagger kullanıcı arayüzü test kullanıcısı
Teklif Dönüştürücü
Veri Sahtekarı
Veritabanı Bağlantı Dizesi Oluşturucu
Veritabanı Oluşturma Aracı
Veritabanı Tablosu Oluşturucu
İp Kaçışı
EXIF'i kaldır
Filigran
GIF'ten MP4'e
Görüntü Arka Planını Kaldır
Görüntü EXIF/Meta Veri/GPS/JPEG Kalite okuyucu
Görüntü Formatları Dönüştürücü
Görüntü Karşılaştır
Görüntü Renk Çeviricisi
Görüntü yeniden boyutlandırıcı
Görüntüden SVG'ye (potrace)
Görüntüyü ve PDF'yi OCRize edin
HEIC Dönüştürücü
ICO/PNG dönüştürücü
Kamera kaydedici
Resmi kırp
SVG Önizleyici
Bash Hile Sayfası
CSS Seçiciler Hile Sayfası
Docker Compose hile sayfası
Docker Hile Sayfası
Docker SWARM hile sayfası
Dockerfile hile sayfası
Ekran Komutları Hızlı Referans Kılavuzu
Git Semantik Commit Hile Sayfası
Git hatırlatma notu
JSONPath Sözdizimi Hile Sayfası
Jq Hile Sayfası
K8s Hile Sayfası
Markdown Hile Sayfası
Nano Hile Sayfası
Nginx Hile Sayfası
PowerShell Hızlı Başvuru Kılavuzu
Regex hile sayfası
Sed hile sayfası
Tmux Komutları Hızlı Referans Kılavuzu
VIM Hile Sayfası
XPath Sözdizimi Hile Sayfası
Yaygın Regex Hile Sayfası
Zellij Komut Hile Sayfası
chmod Komut Hile Sayfası
CSV'den JSON'a
JS'den JSON'a dönüştürücü
JSON Birleşmesi
JSON Düzleştirici/Düzleştirmeyi Kaldırıcı
JSON Editörü
JSON Linter
JSON farkı
JSON güzelleştirme ve biçimlendirme
JSON küçültme
JSON nesneye
JSON sıralama ustası
JSON to CSV
JSON to Go
JSON'dan .env'ye
JSON'dan C#'a
JSON'dan JS'ye dönüştürücü
JSON'dan Java Varlığına
JSON'dan MessagePack'e
JSON'dan TOML'a
JSON'dan TS'ye
JSON'dan Verilere
JSON'dan XML'e
JSON'dan YAML'ye dönüştürücü
Jq/JSONPath Test Cihazı
Json Boyut Analizcisi
Json Kaçış/Kaçış Kaldırıcı
Json Sorgusu
Json dize dönüştürücü
Json'dan PHP Dizisine
Json'dan PHP Koduna
Json'dan Python'a
Json'dan SQL'e DDL
Json'dan Şemaya
Mesaj Paketini JSON'a Dönüştür
ObjGen'den JSON'a
PHP Dizisini JSON'a Dönüştürme
tools.json-patch.name
BIP39 şifre oluşturucu
Diceware Şifre Oluşturucu
NanoID üreteci
OTP kod üreteci
Parola Üreticisi
Pin Kodu Üreticisi
Rastgele sayı üreteci
Sayı üreteci
Token Oluşturucu
UUID dönüştürücü
UUID üreteci
Docker Compose Doğrulayıcı
Docker Compose Format Dönüştürücü
Docker Compose'dan Docker run dönüştürücüsüne
Docker Compose'dan Quadlet'lere
Docker Compose'u .env dosyasına dönüştürme
Docker Compose'u Kubernetes'e dönüştürme
Docker Görüntü İndirici
Docker Pangolin Etiketleri
Docker çalıştırma ve Docker oluşturma dönüştürücüsü
Docker'ı Docker'a denetle
Docker, Kubernetes'e çalıştırılıyor
Docker, Quadlet'lere koşuyor
Dockerfile Etiket Oluşturucu
Kubernetes RBAC Oluşturucu
Traefik Docker Compose Maker
Bahşiş hesaplayıcı
Matematik Formatları Dönüştürücü
Matematik OCR
Matematiksel ifade hesaplayıcı
Trigonometrik/Denklem Eğrisi Görselleştirici
İkili Hesap Makinesi
Fal çarkı
Kart Seçici
Madeni Para Atma Makinesi
Zar Atıcı
HTML'den PDF'ye
PDF Birleştirici
PDF Doğrusallaştır/HızlıWeb
PDF Metin Çıkarıcı
PDF Sayfa Çıkarıcı
PDF Sıkıştırıcı
PDF imza denetleyicisi
PDF Şifreleme
PDF Şifresini Çöz ve Kilidini Aç
TOML Linter
TOML'den JSON'a
TOML'den YAML'ye
Cron/Hafta İçi Alarmı
ETA hesaplayıcı
Geri sayım
Gün Hesaplayıcısı
Hafta Sayıları Dönüştürücü
Hangi Gün?
ICAL Dosya Ayrıştırıcısı
ICAL Jeneratörü
Kronometre
Saat Dilimi Dönüştürücü
Süre Hesaplayıcısı
TTL hesaplayıcısı
Tarih+Süre Hesaplayıcısı
Tarih-saat dönüştürücü
Zaman Alarmı
iCal Birleşmesi
Cron İfade Oluşturucu
BMI Hesaplayıcı
Döviz Dönüştürücü
IBAN doğrulayıcı ve ayrıştırıcı
IES Aydınlatma Yönergeleri
ISBN Doğrulayıcı ve Ayrıştırıcı
ISO 3166 Ülke Kodları Arama Aracı
ISO 639 Arama Aracı
KDV Numaraları Doğrulayıcı
Kabuk Komutlarını Açıklayın
Koşu Hızı Hesaplayıcı
Kredi Kartı Denetleyicisi
Luhn Doğrulayıcı
RMB Büyük Harf Dönüştürücü
SLA hesaplayıcısı
Takvim Dönüştürücü
Telefon ayrıştırıcı ve biçimlendirici
Unicode Arama
Yazılım lisans uyumluluğu
Çevrimiçi Sözlük
CSS Birim Dönüştürücü
CSS Gradyan Oluşturucu
CSS XPath Dönüştürücü
CSS güzelleştirici
Cihaz bilgileri
Görüntüden CSS'ye
HTML Güzelleştirici
HTML Küçültücü
HTML WYSIWYG düzenleyici
HTML temizleyici
HTML varlıklarından kaçış
HTML'den XHTML'e
HTML'den veriye
HTTP durum kodları
Kullanıcı aracı ayrıştırıcısı
MIME türleri
REM Piksel dönüştürücü
Renk Kontrast Denetleyicisi
Renk dönüştürücü
Renk Çemberi
SVG placeholder oluşturucu
Slugify dizesi
URL Metin Arama Parçası Oluşturucu
URL Temizleyici
URL Yakalayıcı
URL biçimli dizeleri kodla/kodunu çöz
UTM URL Oluşturucu
ObjGen'den HTML'ye
XML Linter
XML biçimlendirici
XML'den JSON'a
XPath Test Cihazı
XSLT test cihazı
YAML Birleşmesi
YAML Düzleştirici/Düzleştirici
YAML güzelleştirici
YAML'den JSON'a dönüştürücü
YAML'den TOML'ye
AI için dosyaları paketle
AI İstemi Ayırıcı
ASCII Art Metin Oluşturucu
Akıllı Metin Değiştirici ve Satır Sonlandırıcı
Alıntı Oluşturucu
Denizkızı ihracatçısı
Dize karartıcı
Emoji seçici
Farklı Kelimeler
GPT Token Kodlayıcı/Kod Çözücü
GPT Token Tahmincisi
Görüntüden ASCII Sanatına
HTML'den metin çıkar
I ve L Denetleyicisi
JSON'dan TOON'a
Kasa dönüştürücü
Klasör Yapısı Diyagramı
Klavye Düzeni Dönüştürücü
Levenshtein Hesap Makinesi
Liste dönüştürücü
Listeleri Karşılaştır
Merhaba jeneratör.
Metin farkı
Metin istatistikleri
Metin Çevirmeni
Metinden Unicode Adlarına
Mors Kodu Dönüştürücü
NATO alfabesine metin
RSVP Okuyucusu
Rastgele Satır Seçici
Regex Test Cihazı
Rün dönüştürücü
Sed Komut üreteci
Sekme tuşuyla boşluklara geçin
Sosyal Bağlantı Paylaşıcısı
TOON'dan JSON'a
Unicode Biçimlendirici
Unicode'dan GSM-7'ye
Yazı Tipi Karşılaştır
Yinelenen Satır Bulucu
Zalgo Jeneratörü/Banner
Benchmark oluşturucu
Coğrafi mesafe hesaplayıcısı
En Boy Oranı Hesaplayıcısı
Yüzdelik Hesaplayıcı
Epub'dan Markdown'a
Html'den Markdown'a
Markdown Editörü
Markdown Farkı
Markdown Lorem Ipsum
Markdown Tablo Güzelleştirici
Markdown Tablosu Oluşturucu
Markdown olarak yapıştır
Markdown toc oluşturucu
Markdown önizlemesi
Markdown'dan DOCX'e
Markdown'dan HTML'ye
Markdown'dan Metne
Markdown'dan veriye
tools.markdown-format-converter.name

Git hatırlatma notu

Git, merkezi olmayan bir sürüm yönetim yazılımıdır. Bu hatırlatma notu ile en yaygın git komutlarına hızlıca erişebileceksiniz.

Git is a distributed version control system: every clone is a full repository with its own history, branches and tags. This is a quick reference for the commands that come up daily — placeholders are written as <file>, <branch>, <commit> and <url>.

💡 Every command below has its own help (git rebase --help), and the destructive ones (clean, push, rm, mv) take -n / --dry-run to preview what would happen.

⚙️ Configuration

# identity used on every commit
git config --global user.name "<name>"
git config --global user.email "<email>"

# name of the branch created by git init
git config --global init.defaultBranch main

# editor for messages, rebases, ...
git config --global core.editor "code --wait"

# rebase instead of merging on pull
git config --global pull.rebase true

# plain 'git push' works on new branches
git config --global push.autoSetupRemote true

# every setting and the file it came from
git config --list --show-origin

# override for this repository only
git config --local user.email "<work-email>"

Handy aliases:

git config --global alias.st status

git config --global alias.co checkout

git config --global alias.lg "log --oneline --graph --decorate --all"

git config --global alias.last "log -1 --stat"

🚀 Get Started

# create a repository in the current directory
git init

# clone a remote repository
git clone <url>

# clone into a specific directory
git clone <url> <directory>

# clone and check out one branch
git clone --branch <branch> <url>

# shallow clone, latest commit only
git clone --depth 1 <url>

# clone including submodules
git clone --recurse-submodules <url>

# what is staged, changed, untracked
git status

# the same, in short format
git status -sb

➕ Staging

# stage a specific file
git add <file>

# stage everything under the current directory
git add .

# stage everything in the repository, deletions included
git add -A

# interactively stage individual hunks
git add -p <file>

# stage modifications and deletions, not new files
git add -u

# unstage, keep the changes in the working tree
git restore --staged <file>

# stop tracking a file, keep it on disk
git rm --cached <file>

# rename and stage in one step
git mv <old> <new>

# which .gitignore rule is hiding this file?
git check-ignore -v <file>

✅ Commit

# commit what is staged
git commit -m "<message>"

# stage tracked changes and commit
git commit -am "<message>"

# rewrite the last commit (message + content)
git commit --amend

# amend without changing the message
git commit --amend --no-edit

# fixup commit, squashed later by --autosquash
git commit --fixup <commit>

# add a Signed-off-by trailer
git commit -s -m "<message>"

# empty commit, e.g. to trigger CI
git commit --allow-empty -m "<message>"

⚠️ --amend rewrites history. Only amend commits that have not been pushed to a shared branch.

🌿 Branches

# list local branches
git branch

# local and remote-tracking branches
git branch -a

# last commit and upstream of each branch
git branch -vv

# switch to an existing branch
git switch <branch>

# create a branch and switch to it
git switch -c <branch>

# jump back to the previous branch
git switch -

# older equivalent of switch -c
git checkout -b <branch>

# branch off a specific commit or tag
git switch -c <branch> <commit>

# rename a branch
git branch -m <old> <new>

# delete a merged branch
git branch -d <branch>

# force-delete an unmerged branch
git branch -D <branch>

# branches already merged into HEAD (safe to delete)
git branch --merged

🔀 Merging & Rebasing

# merge a branch into the current one
git merge <branch>

# always create a merge commit
git merge --no-ff <branch>

# bring in the changes as one staged change set
git merge --squash <branch>

# bail out of a conflicted merge
git merge --abort

# replay the current branch on top of another
git rebase <branch>

# interactively squash, reword, drop, reorder commits
git rebase -i HEAD~5

# apply the --fixup commits automatically
git rebase -i --autosquash <base>

# resume after resolving conflicts
git rebase --continue

# drop the conflicting commit and continue
git rebase --skip

# return to the state before the rebase
git rebase --abort

# resolve conflicts with the configured merge tool
git mergetool

Resolving a conflict:

# 1. see which files conflict
git status

# 2. edit them and remove the <<<<<<< ======= >>>>>>> markers

# 3. mark each resolved file
git add <file>

# 4. resume (during a merge: git merge --continue)
git rebase --continue

⚠️ Rebasing rewrites commits. Never rebase a branch other people are already working on.

🌍 Remotes & Syncing

# list remotes and their URLs
git remote -v

# add a remote
git remote add origin <url>

# point a remote somewhere else
git remote set-url origin <url>

# rename a remote
git remote rename <old> <new>

# forget a remote
git remote remove <name>

# download objects and refs, change nothing
git fetch origin

# fetch everything, drop deleted remote branches
git fetch --all --prune

# fetch + merge (or rebase) the upstream branch
git pull

# replay local commits on top of the upstream
git pull --rebase

# push the current branch
git push

# push and set the upstream tracking branch
git push -u origin <branch>

# force-push, but refuse to clobber new commits
git push --force-with-lease

# delete a remote branch
git push origin --delete <branch>

# push all tags
git push origin --tags

⚠️ Prefer --force-with-lease over --force: it aborts if someone else pushed in the meantime.

📦 Stashing

# shelve tracked changes and clean the working tree
git stash

# include untracked files
git stash -u

# stash specific paths with a label
git stash push -m "<message>" <file>

# list every stash
git stash list

# show a stash as a patch
git stash show -p stash@{0}

# re-apply the newest stash and drop it
git stash pop

# re-apply a specific stash, keep it in the list
git stash apply stash@{2}

# create a branch from a stash and apply it
git stash branch <branch>

# delete one stash
git stash drop stash@{0}

# delete all stashes
git stash clear

🔍 Inspecting

# the whole history as a compact graph
git log --oneline --graph --decorate --all

# history of a file, with diffs
git log -p <file>

# history of a file, following renames
git log --follow <file>

# filter by date and author
git log --since="2 weeks ago" --author=<name>

# search commit messages
git log --grep="<pattern>"

# commits that added or removed a string
git log -S"<string>"

# commits in b that are not in a
git log <branch-a>..<branch-b>

# commit count per author
git shortlog -sn

# a single commit with its diff
git show <commit>

# working tree vs. index
git diff

# index vs. last commit
git diff --staged

# between two commits
git diff HEAD~1 HEAD

# changes since the branches diverged
git diff <branch-a>...<branch-b>

# summary of changed files
git diff --stat

# who last touched every line
git blame <file>

# blame a range of lines only
git blame -L 10,40 <file>

# search the tracked files
git grep "<pattern>"

# every position HEAD has had — your safety net
git reflog

🍒 Cherry-pick

# apply one commit onto the current branch
git cherry-pick <commit>

# apply a range of commits
git cherry-pick <commit-a>^..<commit-b>

# apply without committing
git cherry-pick -n <commit>

# after resolving conflicts
git cherry-pick --continue

# undo the whole cherry-pick
git cherry-pick --abort

🏷 Tags

# list tags
git tag

# list matching tags
git tag -l "v1.*"

# annotated tag on HEAD
git tag -a v1.0.0 -m "Release v1.0.0"

# tag an older commit
git tag -a v1.0.0 <commit>

# show a tag and its commit
git show v1.0.0

# push one tag
git push origin v1.0.0

# push all tags
git push origin --tags

# delete a local tag
git tag -d v1.0.0

# delete a remote tag
git push origin --delete v1.0.0

# closest tag to the current commit
git describe --tags

🧯 I’ve Made a Mistake

# fix the last commit message
git commit --amend

# undo the last commit, keep the changes unstaged
git reset HEAD~1

# undo the last n commits, keep the changes
git reset HEAD~<n>

# undo the last commit and throw the changes away
git reset --hard HEAD~1

# discard changes to one file
git restore <file>

# discard every uncommitted change
git restore .

# restore a file as it was at a commit
git restore --source=<commit> <file>

# undo a commit with a new commit (safe when shared)
git revert <commit>

# stage the revert without committing
git revert -n <commit>

# make the local branch match the remote (fetch first)
git reset --hard origin/<branch>

# find the lost commit...
git reflog

# bring a lost commit back on a new branch
git switch -c <branch> <commit>

git reset modes at a glance:

ModeMoves HEADIndex (staging)Working treeUse it to
--soft✅untoucheduntouchedRecommit differently, keep everything staged
--mixed✅resetuntouchedUnstage but keep the edits (default)
--hard✅resetresetThrow the changes away entirely ⚠️

💡 Nothing committed is really lost for ~90 days: git reflog lists every commit HEAD pointed at, even on deleted branches.

🧹 Cleaning

# dry run: what would be removed
git clean -n

# remove untracked files and directories
git clean -fd

# also remove ignored files (build output, node_modules)
git clean -fdx

# compress and tidy the object database
git gc

# drop unreachable objects
git prune

# check the repository for corruption
git fsck

🐛 Debugging

# begin a binary search for a bad commit
git bisect start

# a commit that is broken (often HEAD)
git bisect bad <commit>

# a commit that was fine
git bisect good <commit>

# let a test script decide automatically
git bisect run <command>

# end the search and return to the original HEAD
git bisect reset

# follow lines moved from other files
git blame -C <file>

🧩 Submodules & Worktrees

# add a submodule
git submodule add <url> <path>

# check out every submodule
git submodule update --init --recursive

# update submodules to their latest commit
git submodule update --remote

# commit each submodule sits on
git submodule status

# check out a second branch side by side
git worktree add ../<dir> <branch>

# list linked working trees
git worktree list

# remove one again
git worktree remove ../<dir>

🧠 Miscellaneous

# rename the local default branch
git branch -m master main

# graph of merge commits only
git log --graph --merges

# export a snapshot without .git
git archive -o release.zip HEAD

# contributions per author
git shortlog -sn --no-merges

# full SHA of the current commit
git rev-parse HEAD

# name of the current branch
git rev-parse --abbrev-ref HEAD

# repository size on disk
git count-objects -vH

# enable background repacking (Git 2.30+)
git maintenance start

Update a feature branch with the latest mainline:

git switch <branch>
git fetch origin <main-branch>
git rebase origin/<main-branch>   # or: git merge origin/<main-branch>

📚 Resources

  • Official documentation
  • Pro Git (free book)
  • Interactive branching tutorial
  • Dangit, Git!?! — recovering from the classic mistakes