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.
Find your situation
- 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.
Who does what
You
- 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.
Your AI tool
- 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.
Hand this to your AI tool
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. This comes from https://buildladder.com/answers/private-or-public-repo. If you can open web pages, read https://buildladder.com/answers/private-or-public-repo.md for the current version. BuildLadder guide, tool, concept, answer and setup pages all work this way: add .md to the address. Ask me before you install anything, sign in to anything or spend money. Never ask me to paste a password or secret key into this chat.
Where to go next
Updated Sources: Netlify project visibility, Vercel deploys from Git, GitHub: setting repository visibility, GitHub: licensing a repository, GitHub Pages, Next.js environment variables.