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

Git Alt Modüllerine Giriş

Git alt modüllerinin ne olduğunu, kullanım alanlarını ve bağımlılıkları yönetmek için ne zaman uygun bir çözüm olduklarını anlayın.

Git Alt Modüllerine Giriş, 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.

Welcome to Submodules

What are Git Submodules? They let you embed one Git repository inside another as a sub-directory. It's like having a separate project living inside your main project, but still managed independently.

Why Use Submodules?

Imagine your project needs a specific library or component that's developed and maintained separately. Instead of copying its code, you can use a submodule.

  • Vendor Code: Include third-party libraries.
  • Shared Components: Reusable code across multiple projects.
  • Plugin Systems: Modularize parts of a larger application.

A Repo within a Repo

A submodule isn't just a folder of files. It's a pointer to a specific commit in another Git repository. Your main project tracks which commit of the submodule it should use.

This means your main project doesn't directly manage the submodule's content, but rather its reference.

How Git Tracks Submodules

Git stores submodules as a special entry in your main repository's index. It records the submodule's path, the URL of its remote repository, and the specific commit hash it currently points to.

When you clone a project with submodules, you'll initially see empty directories until you initialize and update them.

Submodule's Independent Life

Each submodule is its own standalone Git repository. You can clone it, switch branches, commit changes, and push them, all independently of the parent repository.

This isolation is key to managing external dependencies without merging their history into your main project.

Common Use Cases

Submodules are excellent for:

  • Stable Dependencies: When you need a specific version of an external library and don't want it to change unexpectedly.
  • Large Components: Breaking down a monolithic project into smaller, manageable, independently versioned parts.
  • Open-Source Contributions: Integrating external tools or frameworks without maintaining their source directly.

When Submodules Shine

They are particularly useful when:

  • You need to track a specific version of a dependency, not just the latest.
  • The dependency is managed by a different team or project.
  • You want to keep the dependency's history separate from your main project's history.

The .gitmodules File

When you add a submodule, Git creates a special configuration file at the root of your main repository: .gitmodules.

This file stores the mapping between the submodule's local path and its remote URL. It's version-controlled, so everyone cloning your project knows about its submodules.

[submodule "library"]
  path = lib/my-library
  url = https://github.com/user/my-library.git

Subtree vs. Submodule (Brief)

While submodules are great, they have alternatives. One notable option is Git Subtree.

Submodules keep the dependency's history separate, while Git Subtree integrates the dependency's history directly into your main repository. We'll explore Subtree in a later lesson!

Quick Check on Submodules

Let's check your understanding of Git submodules.

Recap: Intro to Submodules

We've introduced Git submodules, understanding them as a way to embed independent Git repositories within your main project.

  • They track specific commits of external repos.
  • They solve problems of shared code and stable dependencies.
  • They are configured via the .gitmodules file.

Next, we'll learn how to add and clone submodules.

Sıkça Sorulan Sorular

“Git Alt Modüllerine Giriş” dersi ücretsiz mi?

Evet — “Git Alt Modüllerine Giriş” 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.

“Git Alt Modüllerine Giriş” dersinde ne öğreneceğim?

Git alt modüllerinin ne olduğunu, kullanım alanlarını ve bağımlılıkları yönetmek için ne zaman uygun bir çözüm olduklarını anlayın. 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.

“Git Alt Modüllerine Giriş” 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