Sitemap
Sona

Sona

It's about you. Chin up and be the main character you always adore.

Press enter or click to view image in full size
Photo by Praveen Thirumurugan on Unsplash

Fork vs Clone in Git

2 min readNov 7, 2025

--

This will help you understand the difference between forking a repo and cloning a repo in GitHub

Get Sona’s stories in your inbox

Join Medium for free to get updates from this writer.

As a software engineer/enthusiast, you would’ve heard of “forking” and “cloning” a repository many times. While most believe these have similar functionality, that is not true at all. Both of these have different purposes and are used for different situations.

What is Forking?

Forking is creating a copy of someone else’s repository to your own account. The repo will now be your own copy, and any changes made to it won’t affect the original repo.

What is Cloning?

Cloning is creating a local copy of the repository that is available on GitHub. This will allow you to make changes to the repo on your local machine and then push the changes back to the original repo.

How to fork a repo?

  1. Open the repository you want to fork.
  2. Click on the fork option available in the top right corner
  3. After forking a repo, a copy of the repo will now be available under your account.
  4. Follow the clone steps below to get this repo to your local machine now.

How to clone a repo?

  1. Open the repository you want to clone.
  2. Click on the Code dropdown available near the Add file button.
  3. Copy the HTTPS URL available.
  4. Open your system’s terminal.
  5. Run the following command on where you want to clone the repo.
git clone https://github.com/yourusername/clone-repository-name.git

When should we fork a repo?

You can fork a repo when you want to develop your own version of the project. Forking is usually used when you want to contribute a change to an open-source project. After you’ve done your changes, you can suggest your changes to the original repo using a pull request.

When should we clone a repo?

Cloning is used when you want to work directly on the project. You can push your changes to the direct repo only if you have the required access. This is usually used for members working on a group project.

Connect with me

LinkedIn: https://www.linkedin.com/in/sona-sivasundari-5a454620a/

If there are any suggestions or technologies you want me to write about, comment here and I’ll look into it.

--

--

Written by Sona

It's about you. Chin up and be the main character you always adore.