Category: Question and Answers
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

Whats the difference between Forking and Cloning a project?

Issue

I have a project that I need to make adjustments to, but I want to test those changes in an isolated project. I'm not sure if I should clone or fork the original project, and I need to know the difference between the two processes.

Resolution

To work on a project and test out changes while keeping the original project intact, you can use the forking and cloning processes in GitHub.

Forking the project creates a separate copy of the repository on the GitHub server, under your own account. This allows you to make changes to the code without affecting the original project. You can then collaborate with others on the forked project, and even submit pull requests to the original repository owner to see if they would like to incorporate your changes.

Cloning the repository creates a local copy of the code on your own computer. This allows you to make changes to the code without affecting the upstream or downstream repository. You can then commit changes to the local repository, push those changes to your forked repository on GitHub, and submit a pull request to the original repository owner if they want to incorporate your changes.

Here's an example of forking a repository on GitHub:



  1. Go to the repository you want to fork

  2. Click the "Fork" button in the top right corner

  3. Choose the account you want to fork the project to

  4. Wait for GitHub to create the forked repository

And here's an example of cloning a repository:



  1. Go to the repository you want to clone

  2. Click the "Clone or download" button and copy the repository's URL

  3. Open Git Bash or your preferred terminal

  4. Navigate to the directory where you want to clone the repository using the "cd" command

  5. Type "git clone" followed by the copied URL and press enter

  6. Wait for the repository to clone to your local machine.

Now you can make changes to the project and commit them without affecting the original repository.