DEV Community

Cover image for How to make public repository of private fork
Antoine
Antoine

Posted on

1

How to make public repository of private fork

While studying Fullstack development with Integrify's bootcamp, I have created a couple of private forks from repositories from the different assignments I had to do to learn.
This is all great until the moment you actually need to showcase your portfolio and what you have done during this intense but great learning.
I have faced the issue of making public repository of private fork.

Here are the commands:

  1. Create an empty public repository

  2. Open Terminal

  3. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)
    $ git clone --bare https://github.com/exampleuser/private_repo.git

  4. Mirror-push to the new repository
    $ cd private_repo.git
    $ git push --mirror https://github.com/yourname/public_repo.git

  5. Remove the temporary local repository you created earlier
    $ cd ..
    $ rm -rf private_repo.git

Here you are with your former private fork/repository in your new public one ready to be showcased!

Hope this explanation helps you as much as it helps me!

Top comments (0)

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay