How To Fork Your Own GitHub Repository


The Problem

Forking Your Repository

//clone your new repository
git clone <new repository>.git
//navigate to the repository root
cd <new repository>
//add a reference to your original repository
git remote add upstream <original repository>.git
//pull all code from the original repository
git pull upstream master
//push all code to the new repository
git push origin master
git pull upstream master




Full stack developer — I do code and other fun stuff.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store