skip to content

In GitHub Packages, what happens to a repository's linked container image and its Maven package when the repository is transferred to another organization?

level: seniorimportance: should knowfreq 14%

answer

  1. the registry decides what moves
  2. account-scoped packages stay put
  3. links and inherited access break
  4. who pays afterwards

basics

~10 s

The container image stays in the original organization, its repository link is removed and inherited access is lost. The Maven package moves with the repository, and its billable usage moves to the new owner.

solid answer

~40 s

A transfer treats the two permission models differently. A **granular** package such as a container image is scoped to the account, so it **stays with the original organization**; the **link to the repository is removed**, Codespaces and Actions workflows associated with the repository **lose access**, and if the image inherited access from that repository, its users lose access too. A **repository-scoped** package — Apache Maven or Gradle — is part of the repository, so it **moves with the transfer**, all its billable usage is billed to the **new owner**, and the previous owner may lose access if they are removed as a collaborator. So before transferring, inventory the packages, and for every account-scoped one decide whether to republish it in the new organization or keep it and set access explicitly.

go deeper

for a junior

Recall that container images stay with their original account while Maven and Gradle packages move with the repository.

for a middle

Explain why: granular packages are scoped to an account, repository-scoped packages live inside the repository, and the transfer removes links.

for a senior

Plan the transfer: inventory linked packages, predict which pipelines, people and codespaces lose access, and choose republish or explicit access for each.

for a principal

Treat package ownership as part of moving a product between organizations, so billing, access and consumer references move deliberately rather than by accident.

## Why the registry decides GitHub Packages has two permission models, and a repository transfer follows them exactly: - **Granular registries** — Container, npm, NuGet, RubyGems — scope packages to a personal account or organization. A repository link is an association, not ownership. - **Repository-scoped registries** — Apache Maven and Gradle — publish packages directly into a repository, and the package always inherits that repository's permissions. When you transfer a repository to another personal account or organization, GitHub "may transfer the packages associated with the repository, depending on the registry the packages belong to." In practice that means: | | Container image (granular) | Maven package (repository-scoped) | |---|---|---| | Owner after transfer | Unchanged: the original organization | The repository's new owner | | Link to the repository | Removed | The package is part of the repository | | Actions workflows and codespaces of the repository | Lose access to the package | Follow the repository's permissions | | Users who had inherited access | Lose access | Follow the repository's new access | | Billing | Stays with the original owner | All billable usage moves to the new owner | | Previous owner | Still owns it | May lose access if removed as a collaborator | ## What breaks on the day For the container image, three things fail at once after the transfer: 1. **The transferred repository's pipelines** can no longer push or pull the image with `GITHUB_TOKEN`, because their access came through the link or inheritance that the transfer removed. 2. **People who reached the image through repository inheritance** are cut off; the image now has no linked repository to inherit from. 3. **Codespaces** launched from the repository lose access to the image as well. The image itself keeps serving anyone who still has a direct role on it, and public images keep pulling anonymously. The Maven package, by contrast, follows the repository: it is now listed under the new owner and charged to them. ## Planning a transfer A transfer is a good moment to inventory every package linked to the repository and pick a path for each granular one: 1. **Republish into the new organization.** Build and push the image or package under the new organization's namespace, link it there, and update consumers' references. This keeps ownership, billing and access with the team that now owns the code. 2. **Keep it in the original organization** and set access explicitly. A private or internal organization package can be shared only with that organization's members and teams, so this path suits cases where the original organization remains the real owner. 3. **Retire it** when the transfer is the moment to stop publishing it, deleting old versions within the limits on public packages. For repository-scoped packages there is less to decide, but someone has to accept the **billing change** and confirm the previous owner's people still have the access they need, or lose it on purpose. ## Questions to ask before you click - Which packages are linked to this repository, and in which registries? - Which of them inherit access, and who would lose it? - Which pipelines, deployments and codespaces pull them, and what will they authenticate with afterwards? - Who will pay for repository-scoped package storage and transfer from now on? ## Misreadings to avoid - "Packages always move with the repository." Only repository-scoped ones do. - "The link survives and just points at the new location." It is removed. - "Inherited access re-attaches to the new repository automatically." It does not; there is no link left to inherit through. - "Billing stays with the old owner until the package is republished." For Maven and Gradle, billable usage moves to the new owner with the transfer. How repository transfer itself works — who may transfer, what happens to issues, redirects and collaborators — is covered by the material on GitHub repository permissions; the package consequences above are the part a registry owner has to plan.

  • In GitHub Packages, after a transfer, the moved repository's workflow gets 403 pushing its image. Why, and what are the fixes?
    The image stayed with the original organization and lost its link, so access through the link or inheritance is gone. The usual fix is to republish the image under the new organization and link it there. Keeping it in the old organization means setting access deliberately, and a private or internal organization package can be shared only with that organization's members and teams.
  • In GitHub Packages, who pays for a transferred repository's Gradle package storage after the transfer?
    The new owner. Gradle and Maven packages are published directly into the repository, so GitHub transfers them with it and all their billable usage is billed to the repository's new owner.

  • All of a repository's packages move with it when it is transferred.
  • The link between an image and its repository survives a transfer.
  • Inherited package access re-attaches to the new repository automatically.
  • A transferred Maven package stays billed to the previous owner.
  • A transfer deletes the linked container images.