Etkileşimli Yeniden Tabanlama ve Değişiklikleri Düzeltme
Daha temiz işlemeler için `git rebase -i` ile geçmişi yeniden yazmayı ve son işlemeyi değiştirmek için `git commit --amend` kullanmayı öğrenin.
Etkileşimli Yeniden Tabanlama ve Değişiklikleri Düzeltme, CoddyKit'te ücretsiz bir Git Advanced: Monorepo, Submodules & Workflows dersidir. Bu, 4 dersinin 1. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Git Advanced: Monorepo, Submodules & Workflows öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Git Advanced: Monorepo, Submodules & Workflows kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
Clean Up Your Git History
Git history gets messy — a forgotten file, a typo'd message, ten tiny commits that should be one. Git lets you rewrite history to clean it up.
Amending Your Last Commit
git commit --amend fixes your most recent commit: change the message, add forgotten files, or tweak content. It replaces the last commit with a tidier one.
Amending a Commit Example
Forgot a file right after committing? Stage it, then git commit --amend folds it into the last commit. Here's the flow.
# 1. Make some changes and commit
echo "Initial content" > file1.txt
git add file1.txt
git commit -m "Add file1"
# 2. Realize you forgot file2.txt
echo "More content" > file2.txt
git add file2.txt
# 3. Amend the last commit to include file2.txt
git commit --amend --no-editIntroducing Interactive Rebase
Need to fix commits further back, not just the last one? Interactive rebase (git rebase -i) is a full editor for a series of commits.
Getting Started with Rebase -i
Start an interactive rebase by naming a commit before your target range. To edit the last three commits, use HEAD~3.
git rebase -i HEAD~3Rebase Commands: Pick, Reword, Squash
The rebase editor lists commits with commands you can swap: pick keeps it, reword edits the message, squash/fixup merge it up, edit pauses to amend.
Rewording a Commit Message
To change an older commit's message, switch its line from pick to reword in the editor. Git then prompts you for the new message.
# Original rebase editor content:
# pick 8a9b3c4 Add initial feature
# pick d1e2f34 Fix typo in docs
# Change 'pick' to 'reword' for the first commit:
# reword 8a9b3c4 Add initial feature
# pick d1e2f34 Fix typo in docsSquashing Commits Together
Got several small commits that belong together? squash merges them into one meaningful commit — change the lines below pick to squash.
# Original commits:
# pick abc1234 Add user registration form
# pick def5678 Add validation for email field
# pick ghi9012 Fix styling on form
# To squash the last two into the first:
# pick abc1234 Add user registration form
# squash def5678 Add validation for email field
# squash ghi9012 Fix styling on formEditing an Older Commit
The edit command pauses the rebase at a specific commit. Make changes, git add, git commit --amend, then git rebase --continue.
When to Be Careful with Rewriting
Rewriting changes commit IDs — safe for local-only commits. Never rewrite history that's already pushed and shared; it wrecks your collaborators' work.
Quick Check: History Rewriting
You've made a commit with the message "Fix bug". You then realize you forgot to include one small file in that commit. What is the most appropriate Git command to fix this, assuming you haven't pushed the commit yet?
Recap: Cleaner Commits
Recap: git commit --amend fixes the last commit, while git rebase -i rewrites a series — reword, squash, fixup, or edit. Just be careful on shared branches.
Sıkça Sorulan Sorular
“Etkileşimli Yeniden Tabanlama ve Değişiklikleri Düzeltme” dersi ücretsiz mi?
Evet — “Etkileşimli Yeniden Tabanlama ve Değişiklikleri Düzeltme” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Git Advanced: Monorepo, Submodules & Workflows kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Git Advanced: Monorepo, Submodules & Workflows kursu toplamda 4 dersten oluşur.
“Etkileşimli Yeniden Tabanlama ve Değişiklikleri Düzeltme” dersinde ne öğreneceğim?
Daha temiz işlemeler için `git rebase -i` ile geçmişi yeniden yazmayı ve son işlemeyi değiştirmek için `git commit --amend` kullanmayı öğrenin. Git Advanced: Monorepo, Submodules & Workflows ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Git Advanced: Monorepo, Submodules & Workflows öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Git Advanced: Monorepo, Submodules & Workflows, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 1. dersidir.
“Etkileşimli Yeniden Tabanlama ve Değişiklikleri Düzeltme” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Git Advanced: Monorepo, Submodules & Workflows dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Git Advanced: Monorepo, Submodules & Workflows dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- Etkileşimli Yeniden Tabanlama ve Değişiklikleri Düzeltme
- Değişiklikleri Geçici Olarak Saklama ve Seçerek Uygulama
- Kurtarma için Reflog
- Bisect: Hatalı Commit'leri Bulma