✅ fork vs clone in git
how are they different? ive read some stuff online but i still dont get it
3 Replies
It's about ownership
Forking creates a new repository under your account, which in no way related to the original repo. It just stems off the repo like a branch does from other branches
Cloning means you pull in the actual repository to work on instead of making a copy under your own name. You work on the repo from the actual owner instead.
Difference here is you often don't have write access to a repo but still want to contribute. In that case fork the repo which gives write access (but under your version only), contribute changes in a branch, then request a pull/merge request to the main repo using your branch changes.
Cloning and having write access means you just make a branch directly and contribute inside the actual repo. Depending on its rules you either make a pull/merge request or skip this entirely and just push the changes.
https://graphite.dev/guides/git-clone-vs-fork
If you have no further questions, please use /close to mark the forum thread as answered
alright ty ❤️