DEV Community

dtnf45
dtnf45

Posted on

3 3

git fork vs git clone on a command line

Whats the difference between a fork and a clone?

fork: you are creating a copy of the repository using your github id (if you are using github). If you create changes it the forked repository, you have to create a pull request to the original repository

technically fork is not a git command. So you will have to use something that is available on Github, GitLab etc..

If you are using Github. First install gh. Eg. on a mac

brew install gh

To login:

gh auth login --web

To fork a repo: E.g to fork Netflix Conductor repo

gh repo fork https://github.com/Netflix/conductor.git --clone

clone Cloning a repo will create a local copy on our computer so that it can sync between both the local and remote locations of the repo. Cloning is good when you want to get your own copy of a repository where you may not be contributing to the original project.

To clone:

git clone https://github.com/Netflix/conductor.git

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay