Skip to content

Instantly share code, notes, and snippets.

@adamcrussell
Last active May 2, 2019 03:31
Show Gist options
  • Save adamcrussell/c17c7b5549939e6fe95b3acfc4b9bd29 to your computer and use it in GitHub Desktop.
Save adamcrussell/c17c7b5549939e6fe95b3acfc4b9bd29 to your computer and use it in GitHub Desktop.
Fork A GitHub Repo You Own
# the initial clone of the repo we want to "fork"
git clone https://github.com/original
# clone from folder we just got from github to a new location (which will be
# created by this command)
git clone original my-fork
##
# [create new repo for my-fork on githubcom]
##
# remote for the new repo
git remote set-url origin https://github.com/my-fork.git
# OPTIONAL. by setting this we can fetch and merge with the repo we "forked" from
git remote add upstream https://github.com/my-fork.git
# perform initial commit to new repo
git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment