gh-repo-set-default - Configure default repository for this directory
Contents
Description
This command sets the default remote repository to use when querying the GitHub API for the locally
cloned repository.
gh uses the default repository for things like:
• viewing and creating pull requests
• viewing and creating issues
• viewing and creating releases
• working with GitHub Actions
• adding repository and environment secrets
Example
Interactively select a default repository:
$ gh repo set-default
Set a repository explicitly:
$ gh repo set-default owner/repo
View the current default repository:
$ gh repo set-default --view
Show more repository options in the interactive picker:
$ git remote add newrepo https://github.com/owner/repo
$ gh repo set-default
Name
gh-repo-set-default - Configure default repository for this directory
Options
-u, --unset
unset the current default repository
-v, --view
view the current default repository
See Also
gh-repo(1) Jan 2025 GH-REPO-SET-DEFAULT(1)
Synopsis
ghreposet-default[<repository>][flags]
