0Pricing
Git Advanced: Monorepo, Submodules & Workflows · Ders

Alt Modülleri Kaldırma ve Başlatmasını Sonlandırma

Bir Git alt modülünü depodan kaldırmak için başlatmayı sonlandırma, .gitmodules temizliği ve geride durum bırakmama dahil doğru ve eksiksiz işlemleri öğrenin.

Alt Modülleri Kaldırma ve Başlatmasını Sonlandırma, CoddyKit'te ücretsiz bir Git Advanced: Monorepo, Submodules & Workflows dersidir. Bu, 4 dersinin 4. 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.

When You Need to Remove a Submodule

Submodules are added to pull in external code, but requirements change. You may need to remove one when the dependency is replaced, vendored directly, or simply no longer needed.

Removal is more involved than deleting a folder: a submodule lives in several places at once, and missing one leaves your repo in a broken state.

Where a Submodule Lives

A submodule has three footprints:

  • .gitmodules — the declarative config
  • .git/config — your local active config
  • .git/modules/<path> — the cached submodule git data

Plus the working tree folder itself. Clean removal touches all of these.

Step 1: Deinitialize

Start with git submodule deinit. This unregisters the submodule and removes its entry from .git/config, leaving the rest intact for now.

git submodule deinit -f path/to/submodule

Step 2: Remove from the Index

Use git rm to remove the submodule from tracking and from the working tree. This also updates .gitmodules automatically in modern Git.

git rm -f path/to/submodule

Step 3: Clean the Cached Git Data

The submodule's git data lingers under .git/modules. Remove it so a future submodule with the same path does not collide.

rm -rf .git/modules/path/to/submodule

Verify .gitmodules Is Clean

Open .gitmodules and confirm the [submodule "..."] block is gone. If git rm left an empty file or a stale entry, fix it by hand and stage the change.

git diff --cached .gitmodules

Step 4: Commit the Removal

The removal must be committed so collaborators get the change. The commit captures the deleted folder, the updated .gitmodules, and the dropped index entry.

git commit -m 'Remove path/to/submodule'

The Manual Fallback

On older Git versions git rm may not edit .gitmodules for you. The manual path:

git config -f .gitmodules --remove-section submodule.path/to/submodule
git add .gitmodules
git rm --cached path/to/submodule
rm -rf path/to/submodule

What Collaborators See

When teammates pull the removal commit, the folder disappears from tracking. But their local .git/modules cache and .git/config entry may persist. Tell them to run git submodule sync and clean up if needed.

Common Mistakes

  • Deleting only the folder with rm -rf — leaves a broken index entry
  • Forgetting .git/modules cleanup — blocks re-adding the same path
  • Not committing the .gitmodules change — others still see the submodule

A Reusable Checklist

Whenever you remove a submodule, run through: deinit, rm, clean modules cache, verify .gitmodules, commit. Following the same order every time prevents the half-removed states that confuse a whole team.

Quick Check

Test your understanding of removing submodules.

Recap

You learned the complete removal procedure: deinit to unregister, git rm to drop tracking, clean .git/modules to clear the cache, verify .gitmodules, then commit. Following this checklist every time keeps both your repo and your collaborators' clones healthy.

Sıkça Sorulan Sorular

“Alt Modülleri Kaldırma ve Başlatmasını Sonlandırma” dersi ücretsiz mi?

Evet — “Alt Modülleri Kaldırma ve Başlatmasını Sonlandırma” 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.

“Alt Modülleri Kaldırma ve Başlatmasını Sonlandırma” dersinde ne öğreneceğim?

Bir Git alt modülünü depodan kaldırmak için başlatmayı sonlandırma, .gitmodules temizliği ve geride durum bırakmama dahil doğru ve eksiksiz işlemleri öğ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 4. dersidir.

“Alt Modülleri Kaldırma ve Başlatmasını Sonlandırma” 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

  1. Git Alt Modüllerine Giriş
  2. Alt Modül Ekleme ve Kopyalama
  3. Alt Modülleri Güncelleme ve Eşitleme
  4. Alt Modülleri Kaldırma ve Başlatmasını Sonlandırma
← Git Advanced: Monorepo, Submodules & Workflows Sayfasına Dön