To make a GitHub repository public, open the repository, select Settings, scroll to Danger Zone, choose Change visibility, select Public, and complete GitHub’s confirmation prompts. Audit the full Git history, Actions logs, releases, packages, and secrets before exposing the repository.
GitHub repository visibility guides: Make a repository private · Make a repository public · Change visibility with the gh CLI
Do not use a visibility change as a secret-scanning strategy. A deleted file can still exist in Git history, releases, Actions logs, caches, or forks. Rotate exposed credentials before publishing.
Make a private GitHub repository public
- Sign in to GitHub and open the repository.
- Select Settings below the repository name.
- On General, scroll to Danger Zone.
- Next to Change repository visibility, select Change visibility.
- Select Change to public.
- Confirm that you are changing the correct repository.
- Select I have read and understand these effects.
- Select Make this repository public and complete any authentication prompt.
You need repository administrator access. Organization and enterprise owners can restrict who may change visibility, so the Public option may be unavailable even when you administer the repository.
What becomes public?
Treat the whole repository surface as publishable, not only the current default branch:
- Every branch and tag in the repository
- Commit history, including author names and email addresses
- Issues, pull requests, discussions, and their attachments
- Releases and release assets
- GitHub Actions history and logs
- Repository metadata, traffic-facing documentation, and community files
- Packages or GitHub Pages content whose visibility follows the repository
Anyone can view and fork a public repository. GitHub also documents that push rulesets are disabled when a private repository becomes public, so review and re-enable the protections you still need.
Pre-publication security checklist
Complete these checks before changing visibility:
- Scan every Git ref and the complete history for credentials, private keys, tokens, connection strings, customer data, and internal URLs.
- Rotate any secret that was ever committed. Removing it from the latest commit is not enough.
- Review Actions logs, artifacts, environments, variables, and workflow files for sensitive values or internal system names.
- Check issues, pull requests, discussions, wikis, releases, and attachments.
- Confirm that third-party source code, fonts, images, data, and dependencies may legally be redistributed.
- Add an appropriate open-source license if you intend others to use the code. Public visibility alone does not grant reuse rights.
- Review branch protection and rulesets after the change.
- Notify collaborators that their historical contributions and profile links will be publicly visible.
Why can’t I make the repository public?
Check these controls:
- Your repository role must include administrative access.
- Organization owners can prevent members from changing repository visibility.
- Enterprise policy can prohibit public repositories across its organizations.
- Fork visibility follows repository-network rules and may not be independently changeable.
- Managed-user enterprises can limit public contribution and repository behavior.
If policy blocks the change, do not copy the code into a new public repository as a workaround. Ask the organization or enterprise owner to review the intended publication.
Make the repository public with GitHub CLI
gh repo edit OWNER/REPOSITORY \
--visibility public \
--accept-visibility-change-consequences
Then verify the server-side state:
gh repo view OWNER/REPOSITORY --json nameWithOwner,visibility
See the full GitHub CLI visibility guide for authentication, internal repositories, and automation safeguards.
Official GitHub references
Published August 2026.
