/github-for-non-tech

How to make a GitHub repository private?

Learn how to make your GitHub repository private with easy step-by-step instructions. Use the web interface or GitHub CLI to secure your code.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to make a GitHub repository private?

 
Step 1: Logging into your GitHub account
 

Before you can change any repository settings, you need to be signed in.

  • Open your preferred web browser.
  • Navigate to https://github.com.
  • Click the Sign in button in the top-right corner.
  • Enter your username or email address and your password, then click Sign in.

 
Step 2: Navigating to your repositories
 

Once signed in, you’ll need to locate the repository you want to modify.

  • Click on your profile avatar in the top-right corner.
  • Select Your repositories from the dropdown menu.
  • You’ll see a list of all repositories you own or contribute to.

 
Step 3: Selecting the repository to make private
 

Choose the exact repository whose visibility you wish to change.

  • Scroll through the list and click the name of the repository.
  • You will be taken to that repository’s main page.

 
Step 4: Opening the repository settings
 

The repository settings menu contains the visibility controls.

  • On the repository page, locate the menu bar below the repository name.
  • Click the Settings tab (usually at the far right).

 
Step 5: Scrolling down to the visibility controls
 

The visibility options are located in the “Danger Zone.”

  • Scroll down to the bottom of the Settings page until you see the Danger Zone section.
  • Locate the Change repository visibility subsection.

 
Step 6: Changing the repository to private
 

You can now initiate the change from public to private.

  • Click the Change visibility button.
  • In the modal dialog that appears, select Make private.
  • GitHub will ask you to confirm by typing the repository name.
  • Type the full repository name exactly as shown (e.g., username/repository-name).
  • Click the I understand, change repository visibility button.

 
Step 7: Verifying the repository is now private
 

After confirmation, you should see that the repository is private.

  • You will be redirected back to the main repository page.
  • Look next to the repository name—you should now see a Private label instead of Public.

 
Step 8: (Optional) Using GitHub CLI to make a repository private
 

If you prefer the command line and have GitHub CLI installed, you can change visibility without using the web UI.

  • Make sure you have GitHub CLI installed and are authenticated (gh auth login).
  • Navigate in your terminal to any directory (the repo doesn’t need to be cloned locally to change its visibility).

gh repo edit OWNER/REPO --visibility private
  • Replace OWNER/REPO with your username or organization and repository name (for example octocat/hello-world).
  • Press Enter; GitHub CLI will change the repository’s visibility to private.

 
Step 9: Confirming visibility change via GitHub CLI
 

You can double-check the new visibility status directly from the CLI.


gh repo view OWNER/REPO --json visibility
  • If the output shows "visibility": "PRIVATE", the repository is now private.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022