Accessing Fork Commits via Original Repository

susam.net2026年03月28日 00:00

I ran a small experiment with Git hosting behaviour using two demo repositories:

  • cuppa: The original repository.
  • muppa: Fork of cuppa with questionable changes.

Here is a table with links to these repositories on Codeberg and GitHub:

Name Codeberg GitHub
cuppa codeberg.org/spxy/cuppa github.com/spxy/cuppa
muppa codeberg.org/spxy/muppa github.com/spxy/muppa

It is well known that GitHub lets us access a commit that exists only on the fork via the original repository using a direct commit URL. I wanted to find out if Codeberg behaves the same.

The commit f79ef5a exists only on the fork (muppa) but not on the original repo (cuppa). Let us see how the two hosting services handle direct URLs to this commit.

Name Codeberg GitHub
cuppa f79ef5a f79ef5a
muppa f79ef5a f79ef5a

If we look at the second row, both commit URLs for Codeberg and GitHub work because that is where the commit was actually created. The commit belongs to the fork named muppa.

Now if we look at the first row, the commit URL for Codeberg returns a 404 page. This reflects the fact that the commit f79ef5a does not exist on cuppa. However, GitHub returns a successful response and shows the commit. It shows the following warning at the top:

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

There is no particular point to this experiment. I just wanted to know.

Read on website | #technology