fork

A copy of someone else's repository made on a hosting service such as GitHub, under your own account, so you can push to it.

In more detail

Forking is a feature of hosting services, not a git command. You fork when you cannot push to the original, clone your fork, push to it, and then open a pull request asking the original project to take your changes. The original is usually added as a second remote called upstream.

Examples

Workflows triggered by a pull request from a fork get no secrets and a read-only token; never run fork code on a self-hosted runner or under pull_request_target.
OpenTofu was forked from Terraform 1.5.x, the last release under the Mozilla Public License.
In Terraform: On GitHub a fork is usually a personal copy used to propose changes back. A project fork goes further: a new community takes the code in a different direction under its own name and governance. OpenTofu is a project fork of Terraform, taken from the last open source release.

Related terms

Taught in

References

Certification courses