how to change github repository from private to public

How to Make GitHub Repo Public

By David Jackson
AD

Ever found yourself in a situation where you want to share your GitHub project but it's currently private? You're not alone. This happens more often than you think. Thankfully, GitHub makes it easy to change a repository's visibility from private to public. Let's dive into how you can do this step by step.

First, let's understand why you might want to do this. Making your repository public allows others to view, clone, and fork your project. It's a great way to share your work, collaborate with others, or even contribute to open-source projects.

Understanding GitHub Repository Visibility

Before we proceed, it's crucial to understand the different visibility options GitHub provides:

AD
How to Create Your First Repository on Github
How to Create Your First Repository on Github
How to create repository on GitHub - The Tech Edvocate
How to create repository on GitHub - The Tech Edvocate
How To Create A GitHub Repository In This Easy Step-by-step Guide For Beginners.
How To Create A GitHub Repository In This Easy Step-by-step Guide For Beginners.
  1. Public: Anyone on the internet can view and clone this repository.
  2. Internal: Only users signed in to GitHub with a τραγούmnt member of organizations containing the repository can view and clone it.
  3. Private: Only collaborators and users with the personalized token can access this repository.

The default visibility when you create a new repository is private. Now, let's see how to change this.

Changing Visibility on the Repository Page

The easiest way to change your repository's visibility is by doing so directly on the repository's page.

GravityView GitHub access: Changes we’re making and why
GravityView GitHub access: Changes we’re making and why
How To Improve Your GitHub Profile | GitHub Tips For Developers
How To Improve Your GitHub Profile | GitHub Tips For Developers
  1. Go to your GitHub home page and locate the repository you want to change.
  2. Click on the three-dot icon (⋮) next to the repository name and select "Change repository visibility."
  3. Select "Public" from the drop-down menu and click "Done."

Voila! Your repository is now public.

Changing Visibility in the Repository Settings

Another way to change your repository's visibility is through the repository's settings.

AD
  1. Navigate to the repository you want to change.
  2. Click on the "Settings" tab at the top of the repository page.
  3. Scroll down to the "Danger Zone" section and click "Change repository visibility."
  4. Select "Public" from the drop-down menu and click "Save."

Your repository is now viewable to anyone with the link. Simple, isn't it?

Managing Forked Public Repositories

When you make your repository public, any private forks of your repository will also become public. This is because the forks' source is no longer private.

What Happens to My Forks?

If you've forked someone else's private repository and made changes to it, those changes will remain private in your fork. However, anyone can now fork your public fork and make changes to it. It's like a public chain of forks.

AD

Preventing Forks from Becoming Public

If you don't want your forks to become public, you can lock your repository to prevent further forking. This won't affect existing forks (they'll remain as they are), but new forks won't be able to be created.

To lock your repository:

  1. Go to your repository's settings.
  2. Scroll down to the "Danger Zone" section.
  3. Click "Lock repository." This will disable further forking.

Keep in mind, once you lock a repository, you can't unlock it - you'll have to create a new one if you change your mind.

AD

There you have it! You now know how to change a GitHub repository from private to public, understand the implications, and can manage any resulting forks. Happy coding and sharing!

AD