Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions pkg/cmd/repo/rename/rename.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,27 @@ func NewCmdRename(f *cmdutil.Factory, runf func(*RenameOptions) error) *cobra.Co
cmd := &cobra.Command{
Use: "rename [<new-name>]",
Short: "Rename a repository",
Long: heredoc.Doc(`Rename a GitHub repository.

By default, this renames the current repository; otherwise renames the specified repository.`),
Long: heredoc.Docf(`
Rename a GitHub repository.

%[1]s<new-name>%[1]s is the desired repository name without the owner.

By default, the current repository is renamed. Otherwise, the repository specified
with %[1]s--repo%[1]s is renamed.

To transfer repository ownership to another user account or organization,
you must follow additional steps on GitHub.com

For more information on transferring repository ownership, see:
<https://docs.github.com/en/repositories/creating-and-managing-repositories/transferring-a-repository>
Comment thread
andyfeller marked this conversation as resolved.
`, "`"),
Example: heredoc.Doc(`
# Rename the current repository (foo/bar -> foo/baz)
$ gh repo rename baz

# Rename the specified repository (qux/quux -> qux/baz)
$ gh repo rename -R qux/quux baz
`),
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.BaseRepo = f.BaseRepo
Expand Down