GH-REPO-EDIT(1) GitHub CLI manual GH-REPO-EDIT(1)

gh-repo-edit - Edit repository settings

gh repo edit [<repository>] [flags]

Edit repository settings.

To toggle a setting off, use the --<flag>=false syntax.

Changing repository visibility can have unexpected consequences including but not limited to:

  • Losing stars and watchers, affecting repository ranking
  • Detaching public forks from the network
  • Disabling push rulesets
  • Allowing access to GitHub Actions history and logs

When the --visibility flag is used, --accept-visibility-change-consequences flag is required.

For information on all the potential consequences, see ⟨https://gh.io/setting-repository-visibility⟩.

Accept the consequences of changing the repository visibility
Add repository topic
Allow forking of an organization repository
Allow a pull request head branch that is behind its base branch to be updated
Set the default branch name for the repository
Delete head branch when pull requests are merged
Description of the repository
Enable advanced security in the repository
Enable auto-merge functionality
Enable discussions in the repository
Enable issues in the repository
Enable merging pull requests via merge commit
Enable projects in the repository
Enable merging pull requests via rebase
Enable secret scanning in the repository
Enable secret scanning push protection in the repository. Secret scanning must be enabled first
Enable merging pull requests via squashed commit
Enable wiki in the repository
Repository home page URL
Remove repository topic
Make the repository available as a template repository
Change the visibility of the repository to {public,private,internal}

0: Successful execution

1: Error

2: Command canceled

4: Authentication required

NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

# Enable issues and wiki
$ gh repo edit --enable-issues --enable-wiki
# Disable projects
$ gh repo edit --enable-projects=false

gh-repo(1)

Jun 2025