Sitemap

Fork vs Clone: The Mistake That Cost Me My First Push

2 min readAug 6, 2026

--

Press enter or click to view image in full size

I kept typing git clone on repos I didn’t own, then wondering why git push kept failing with permission errors.

The confusion made sense once I saw the two operations aren’t doing the same job at all.

What clone actually does

git clone is a git command. It copies a repository, any repository you have read access to, onto your machine. Nothing about it involves GitHub as a platform. It works on a public repo, a private repo you’ve been granted access to, even a repo sitting on a USB drive.

git clone https://github.com/processing/p5.js-website.git

That command downloads the full history and files, connects it back to where it came from through a remote named origin, and that’s it. You have a copy. You do not, by cloning, gain permission to push changes back to the original.

What fork actually does

Fork isn’t a git command at all. It’s a GitHub feature, server-side, on GitHub’s platform, not something git the tool knows about. Forking creates a full copy of someone else’s repository under your own account, on GitHub’s servers, that you own and have write access to.

Get Ego’s stories in your inbox

Join Medium for free to get updates from this writer.

Once you fork processing/p5.js-website, you now have yourname/p5.js-website, sitting alongside the original, with full push access to it.

Why open source contribution needs both

You can’t push directly to a project you don’t own. So the actual workflow looks like this:

  1. Fork the project on GitHub. This creates your own copy under your account.
  2. Clone your fork to your machine. This gives you a working local copy.
  3. Add the original project as a second remote, usually named upstream, so you can pull in new changes from the real project.
  4. Push your work to your fork (origin), then open a pull request against the original (upstream).

git remote add upstream https://github.com/processing/p5.js-website.git

git fetch upstream

git pull upstream main

origin is your fork. upstream is the real project. Every fetch, pull, or push command needs to know which one it’s talking to. That’s the entire reason both remotes exist side by side.

One clean way to hold onto the distinction: clone is about getting a copy onto your machine. Fork is about getting a copy you’re allowed to write to.

--

--

Ego
Ego

Written by Ego

Frontend Developer | React & Next.js | Opensource Enthusiast | Writer | Technical Writer I build thoughtful UIs and write about the ideas behind the code