Skip to content

Instantly share code, notes, and snippets.

@R0mb0
Forked from clintliang/fork-own-repo.md
Last active April 5, 2022 10:06
Show Gist options
  • Save R0mb0/6249c39792325652f9cea84d463eb861 to your computer and use it in GitHub Desktop.
Save R0mb0/6249c39792325652f9cea84d463eb861 to your computer and use it in GitHub Desktop.
How to Fork Your Own Project on Github (updated to 1 october 2020)

How to Fork Your Own Project on Github

Steps on how to create fork-repo from your own original-repo

On Github.com

  1. Create a new empty fork-repo repository on Github

On local

  1. Clone fork-repo
git clone git@github.com:<YOUR_USERNAME>/fork-repo.git
  1. Add an upstream remote pointing to original-repo
cd fork-repo
git remote add upstream git@github.com:<YOUR_USERNAME>/original-repo.git
  1. Pull from original-repo
git pull upstream main
  1. Push to fork-repo
git push origin main

Sync fork-repo

cd fork-repo
git fetch upstream
git merge upstream/main
git push origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment