Skip to content

Instantly share code, notes, and snippets.

@mecaneer23
Created March 17, 2023 15:31
Show Gist options
  • Save mecaneer23/356eabcf612c10eff04f278462655183 to your computer and use it in GitHub Desktop.
Save mecaneer23/356eabcf612c10eff04f278462655183 to your computer and use it in GitHub Desktop.
How to "fork" without forking in GitHub

Fork without forking

For the purposes of this tutorial, parent-url will refer to the url of the repository you want to clone.

Step 1: clone the repository locally

In a local terminal, run the following:

$ git clone parent-url

Step 2: remove remote url

$ git remote remove origin

Step 3: create a new repository in GitHub

Don't add any files to it yet, all we want is the new repo. Now, copy the url of the new repo, we will call this child-url.

Step 4: add the new child-url to the local repository

Back in your local terminal, run the following command:

$ git remote add origin child-url

Step 5: push the entire local repository to GitHub, at the new url

$ git push -u origin main

Step 6: reload the GitHub window to make sure it all works

Now, feel free to archive or modify the "fork" any way you see fit.

@mecaneer23
Copy link
Author

This might not be necessary if you can just import parent-url in the create new GitHub repository menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment