Fork

Table of contents

Summarise with:

In programming, a fork refers to the creation of a copy or branch of a project or codebase. This term, which comes from English and means «fork», visually describes what happens: from a common point, the code splits into two different paths.

From that point onwards, the two branches can develop independently, pursuing different objectives. Forks are particularly common in open-source software development, as we shall see later when we look at their relationship with GitHub.

How do you create a fork on GitHub?

A fork on GitHub allows developers to create a copy of an existing code repository so that they can work on it independently and develop a customised version of the software.

Steps for creating a fork on GitHub:

  1. Select the repository: Log in to GitHub and navigate to the repository you want to fork.

  2. Click on «Fork»: In the top right-hand corner of the repository page, you’ll see a button labelled «Fork». When you click this button, GitHub will create a copy of the repository in your account.

  3. Clone the fork: Once you have forked the repository, you can clone it onto your local machine using the `git clone` command and the URL of your fork. This will allow you to work on the code locally.

  4. Making changes and committing: You can now make any changes you wish to the code. Once you have finished, you can commit your changes.

  5. Push and pull requests: Finally, push your changes to your GitHub repository using the `git push` command. If you’d like to contribute to the original project, you can create a pull request, which will allow the maintainers of the original repository to review and, potentially, accept your changes to their code.

Forks in cryptocurrencies and blockchain

In the world of cryptocurrencies and blockchain, a fork refers to a split in the blockchain, which occurs when a change is made to the protocol rules. These forks are fundamental to the development and evolution of cryptocurrencies, enabling improvements in security, the correction of errors, or the introduction of new features.

There are two main types of blockchain forks: soft forks y hard forks.

  • Soft fork: A soft fork is a change to the protocol rules that is backwards compatible with the previous version of the software. This means that nodes that have not yet been updated can still participate in the network, albeit with some limitations. In other words, there is still a single blockchain, but the new rules are applied in such a way that they do not break backwards compatibility.

  • Hard fork: A hard fork is a more radical change to the protocol that results in incompatibility with previous versions of the software. As a result, the blockchain splits into two, creating two separate versions of the same network.

Share in:

Related articles

Big Data

Big Data refers to high-volume, highly interrelated data sets from many different sources that are difficult to manage with traditional data processing tools and methods. Three V's of Big Data There are three V's that define Big Data.

Linear regression

Linear regression is a fundamental statistical technique in the world of data analytics and artificial intelligence. It is used to model the relationship between a dependent variable and one or more independent variables, by establishing a straight (linear) line that best fits the relationship between a dependent variable and one or more independent variables.

Gateway

What is a Gateway? A gateway is an access point that acts as an intermediary between two different networks or systems, enabling communication between them. Its main purpose is to translate, adapt and transfer information between two environments that otherwise would not be able to communicate with each other.

Immutability

Immutability refers to the inability of an object or entity to change or be altered once it has been created or defined. In the context of programming, immutable data cannot be modified once it is created. That is to say,

Scroll to Top