# Should my GitHub repository be private or public?

> Private. It stops strangers copying your code, and every BuildLadder hosting guide puts your site online from a private repository. Make it public only when you want people to read or reuse your code.

Web page: https://buildladder.com/answers/private-or-public-repo

## What to do

- If you’re following a BuildLadder hosting guide: Choose private, in your personal GitHub account, not an organization. Vercel’s free Hobby plan can’t build a private repository owned by an organization. If Vercel’s message suggests making it public, move it to your personal account instead.
- If Netlify shows a “Make public” button: That button changes who can open your site, not your repository. Press it when your site is ready for visitors. On the free plan, a private Netlify project can only be opened by you, signed in to Netlify.
- If you want to show your code to an employer, or share it as open source: Ask your AI tool to check the whole Git history for keys first. Anyone can read and fork a public repository. Without a license, default copyright applies, so people can’t reuse your code. Add a license, like MIT, if you want them to.
- If you want free hosting on GitHub Pages: On GitHub’s free plan, Pages only works from a public repository, and making it private later takes the site down. Pages also only hosts plain sites with no server code. For anything else, use a host that builds from a private repository.
- If your repository is public now and you want it private: Open its Settings, scroll to the Danger Zone and choose Change visibility. Copies other people already forked stay public, and stars are erased. If a key was ever in it, rotate that key, because going private doesn’t take it back.

## What you do

- Pick private when you create the repository.
- Keep it in your personal GitHub account.
- Decide if and when to share your code, and choose a license.
- Rotate any key that was ever in the repository before it goes public.

## What your AI tool does

- Check the whole Git history for keys before you make a repository public.
- Explain what changes when you switch visibility.
- Add a license file and a README if you share your code.
- Move your site to a host that builds from a private repository.

## Prompt to copy

```text
I’m thinking about making this product’s GitHub repository public. Before I decide:
1. Search the current files and the whole saved Git history for keys, passwords and .env files. Report file names and commits only, never the values.
2. Tell me if anything else looks private, like personal details, customer data or notes.
3. Explain in plain words what changes for my host, and for anyone who finds the repository, if I make it public.
4. If I want others to reuse my code, help me choose a license and add the file.
Don’t change the repository’s visibility yourself. I’ll do that on github.com.
```

## Sources

Updated 2026-11-10.

- [Netlify project visibility](https://docs.netlify.com/manage/security/secure-access-to-sites/project-visibility/)
- [Vercel deploys from Git](https://vercel.com/docs/git)
- [GitHub: setting repository visibility](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/setting-repository-visibility)
- [GitHub: licensing a repository](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)
- [GitHub Pages](https://docs.github.com/en/pages/getting-started-with-github-pages/what-is-github-pages)
- [Next.js environment variables](https://nextjs.org/docs/app/guides/environment-variables)
