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

# [NAME](#NAME)

gh-repo-edit - Edit repository settings

# [SYNOPSIS](#SYNOPSIS)

**gh repo edit \[&lt;repository&gt;] \[flags]**

# [DESCRIPTION](#DESCRIPTION)

Edit repository settings.

To toggle a setting off, use the **--&lt;flag&gt;=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⟩.

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

# [OPTIONS](#OPTIONS)

[**--accept-visibility-change-consequences**](#accept_visibility_change_consequences)

Accept the consequences of changing the repository visibility

[**--add-topic** **&lt;strings&gt;**](#add_topic)

Add repository topic

[**--allow-forking**](#allow_forking)

Allow forking of an organization repository

[**--allow-update-branch**](#allow_update_branch)

Allow a pull request head branch that is behind its base branch to be updated

[**--default-branch** **&lt;name&gt;**](#default_branch)

Set the default branch name for the repository

[**--delete-branch-on-merge**](#delete_branch_on_merge)

Delete head branch when pull requests are merged

[**-d**, **--description** **&lt;string&gt;**](#d)

Description of the repository

[**--enable-advanced-security**](#enable_advanced_security)

Enable advanced security in the repository

[**--enable-auto-merge**](#enable_auto_merge)

Enable auto-merge functionality

[**--enable-discussions**](#enable_discussions)

Enable discussions in the repository

[**--enable-issues**](#enable_issues)

Enable issues in the repository

[**--enable-merge-commit**](#enable_merge_commit)

Enable merging pull requests via merge commit

[**--enable-projects**](#enable_projects)

Enable projects in the repository

[**--enable-rebase-merge**](#enable_rebase_merge)

Enable merging pull requests via rebase

[**--enable-secret-scanning**](#enable_secret_scanning)

Enable secret scanning in the repository

[**--enable-secret-scanning-push-protection**](#enable_secret_scanning_push_protection)

Enable secret scanning push protection in the repository. Secret scanning must be enabled first

[**--enable-squash-merge**](#enable_squash_merge)

Enable merging pull requests via squashed commit

[**--enable-wiki**](#enable_wiki)

Enable wiki in the repository

[**-h**, **--homepage** **&lt;URL&gt;**](#h)

Repository home page URL

[**--remove-topic** **&lt;strings&gt;**](#remove_topic)

Remove repository topic

[**--squash-merge-commit-message** **&lt;string&gt;**](#squash_merge_commit_message)

The default value for a squash merge commit message: {default|pr-title|pr-title-commits|pr-title-description}

[**--template**](#template)

Make the repository available as a template repository

[**--visibility** **&lt;string&gt;**](#visibility)

Change the visibility of the repository to {public,private,internal}

# [EXIT CODES](#EXIT_CODES)

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.

# [EXAMPLE](#EXAMPLE)

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

# [SEE ALSO](#SEE_ALSO)

[**gh-repo(1)**](/man/os/gh/gh-repo.1)

Oct 2026

---

Document: gh-repo-edit(1) from gh 2.102.0-r1 (Chainguard OS)
Source: https://github.com/cli/cli
