Skip to content

Instantly share code, notes, and snippets.

@hohowin
Last active September 2, 2025 14:30
Show Gist options
  • Select an option

  • Save hohowin/954fba73f5a02d37e15a6ea5e5b10b54 to your computer and use it in GitHub Desktop.

Select an option

Save hohowin/954fba73f5a02d37e15a6ea5e5b10b54 to your computer and use it in GitHub Desktop.
Copy a repo without forking

How to copy a GitHub repo without forking

GitHub only lets you fork a repo once, if you want to make more than one copy of a project here's how you can do it. Useful for starter code.

  1. Create a new empty folder for your project and initialize git

    cd where-you-keep-your-projects
    mkdir your-project-name
    cd your-project-name
    git init
  2. "Pull" the repo you want to copy:

    # git pull <gitreponame> <branchname>
    # git url is the same as the clone URL
    git pull git-url-of-the-repo-you-want-to-copy
  3. Create a new repository for your project on GitHub

  4. Push your code to the new repository you just created

    git remote add origin git-url-of-the-new-repo-you-created (e.g.: https//[email protected]/myname/myrepo.git)
    git push origin master
    
@mikevb3
Copy link

mikevb3 commented Jul 24, 2025

quite helpful! thanks!!

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