Forking and the Fork Network - UP-Manila-SILab/ph-core GitHub Wiki

The GitHub fork network is a conceptual and technical structure that represents how repositories are forked and related to each other. Here's a breakdown of how it works and how it's documented:


🔁 What Is a GitHub Fork?

A fork on GitHub is a personal or organizational copy of someone else's repository. It allows you to freely experiment with changes without affecting the original project. Forks are commonly used to propose changes to someone else's project via pull requests or to use someone else's project as a starting point for your own idea.


🌐 The Fork Network

The fork network refers to the entire tree of repositories that originate from a common ancestor. This includes:

  • The upstream repository (the original).
  • All forks of that repository.
  • Any forks of those forks, recursively.

graph TD
    Upstream["Upstream Repository"]
    UserA["UserA's Fork"]
    UserB["UserB's Fork"]
    UserC["UserC's Fork of UserB"]

    Upstream -->|Fork| UserA
    Upstream -->|Fork| UserB
    UserB -->|Fork of Fork| UserC

GitHub tracks this network and allows users to:

  • View the network graph to see how forks relate.
  • Sync forks with upstream repositories.
  • Submit pull requests across forks.

🧭 Key Features and Improvements

GitHub has introduced several enhancements to fork management:

  1. Syncing Forks: You can now sync your fork with the upstream repository directly from the web UI or via API 1(https://github.blog/developer-skills/github/unboxing-fork-improvements-and-unwrapping-fork-docs/)(https://github.blog/developer-skills/github/unboxing-fork-improvements-and-unwrapping-fork-docs/).
  2. Fork Naming: You can name your fork during creation 1(https://github.blog/developer-skills/github/unboxing-fork-improvements-and-unwrapping-fork-docs/)(https://github.blog/developer-skills/github/unboxing-fork-improvements-and-unwrapping-fork-docs/).
  3. Forking Within the Same Organization: Previously restricted, now allowed for better internal collaboration 1(https://github.blog/developer-skills/github/unboxing-fork-improvements-and-unwrapping-fork-docs/)(https://github.blog/developer-skills/github/unboxing-fork-improvements-and-unwrapping-fork-docs/).
  4. Fork Policies: Enterprise owners can control where forks can be created (e.g., within the same org, to user accounts, etc.) 1(https://github.blog/developer-skills/github/unboxing-fork-improvements-and-unwrapping-fork-docs/)(https://github.blog/developer-skills/github/unboxing-fork-improvements-and-unwrapping-fork-docs/).
  5. Selective Branch Forking: You can fork only the default branch instead of all branches 1(https://github.blog/developer-skills/github/unboxing-fork-improvements-and-unwrapping-fork-docs/)(https://github.blog/developer-skills/github/unboxing-fork-improvements-and-unwrapping-fork-docs/).

🤝 Friendly Forks

GitHub distinguishes between friendly forks and divergent forks:


📚 References and Further Reading

Here are the official GitHub resources that explain these concepts in detail: