GH-REPO-EDIT(1)

πŸ’… gh-repo-edit β€” the GitHub CLI manual, but make it make sense ✨

okay so this is gh-repo-edit, straight out of the GitHub CLI manual, and it's literally the glow-up button for your repo settings. bestie, we're about to redecorate πŸŽ€


🌸 NAME 🌸

gh-repo-edit β€” Edit repository settings. that's it, that's the vibe. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

gh repo edit [<repository>] [flags]

πŸ’– DESCRIPTION πŸ’–

Edit repository settings. yes, all of them. it's giving makeover montage πŸ’…

so here's a thing you need to know β€” and i'm saying this with my whole chest β€” to toggle a setting off, you use the --<flag>=false syntax. like --enable-projects=false. capital-n No Cap.

now, the spicy part 🌢️ β€” 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, the --accept-visibility-change-consequences flag is required. like, you cannot skip that one. it's the terms-and-conditions checkbox but real.

for info on all the potential consequences, see <https://gh.io/setting-repository-visibility> β€” yes i'm linking you, go read it 🫢

also!! when the --enable-squash-merge flag is used, --squash-merge-commit-message can be used to change the default squash merge commit message behavior:

  • default: uses commit title and message for 1 commit, or pull request title and list of commits for 2 or more
  • pr-title: uses pull request title
  • pr-title-commits: uses pull request title and list of commits
  • pr-title-description: uses pull request title and description

iconic behavior honestly πŸ‘‘


✨ OPTIONS ✨

every single flag, right here, no skipping, i would never πŸ™ˆ

  • --accept-visibility-change-consequences β€” Accept the consequences of changing the repository visibility. the adulting flag 🫑
  • --add-topic <strings> β€” Add repository topic
  • --allow-forking β€” Allow forking of an organization repository
  • --allow-update-branch β€” Allow a pull request head branch that is behind its base branch to be updated
  • --default-branch <name> β€” Set the default branch name for the repository
  • --delete-branch-on-merge β€” Delete head branch when pull requests are merged
  • -d, --description <string> β€” Description of the repository
  • --enable-advanced-security β€” Enable advanced security in the repository
  • --enable-auto-merge β€” Enable auto-merge functionality
  • --enable-discussions β€” Enable discussions in the repository
  • --enable-issues β€” Enable issues in the repository
  • --enable-merge-commit β€” Enable merging pull requests via merge commit
  • --enable-projects β€” Enable projects in the repository
  • --enable-rebase-merge β€” Enable merging pull requests via rebase
  • --enable-secret-scanning β€” Enable secret scanning in the repository
  • --enable-secret-scanning-push-protection β€” Enable secret scanning push protection in the repository. Secret scanning must be enabled first ⚠️ (it's a combo move, you can't skip step one)
  • --enable-squash-merge β€” Enable merging pull requests via squashed commit
  • --enable-wiki β€” Enable wiki in the repository
  • -h, --homepage <URL> β€” Repository home page URL
  • --remove-topic <strings> β€” Remove repository topic
  • --squash-merge-commit-message <string> β€” The default value for a squash merge commit message: {default|pr-title|pr-title-commits|pr-title-description}
  • --template β€” Make the repository available as a template repository
  • --visibility <string> β€” Change the visibility of the repository to {public,private,internal}

πŸ”₯ EXIT CODES πŸ”₯

so when the command wraps up, here's what the numbers mean, and honestly? know them. iykyk πŸ’€

  • 0: Successful execution β€” slay πŸ’–
  • 1: Error β€” it's giving oops
  • 2: Command canceled β€” you changed your mind, valid
  • 4: Authentication required β€” log in bestie 😭
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

🌈 EXAMPLE 🌈

real code, verbatim, no cap:

# Enable issues and wiki
$ gh repo edit --enable-issues --enable-wiki

# Disable projects
$ gh repo edit --enable-projects=false

see that =false? that's the off-switch, that's the whole trick πŸŽ€


🧚 SEE ALSO 🧚

  • gh-repo(1) β€” go meet the parent command, she's lovely

and that's the page!! GitHub CLI v2.102.0, dated Oct 2026, written by your fave, delivered with love πŸ’œπŸ«Ά

πŸ“¦ where this page comes from