Skip to content

gh repo create prevents empty description when pushing an existing local repository #7377

@vwkd

Description

@vwkd

Describe the bug

When creating a new repository from an existing local repository, gh repo create defaults to use the repository name if the description is left empty. This prevents to use an empty description. Note, inserting an empty string "" creates a description with "".

A workaround is to open the repository in the Web browser after it was created and delete the description again.

This behavior differs from creating a new repository from scratch, where the description defaults to empty.

Steps to reproduce the behavior

  1. Run gh repo create in a new git repository
  2. Choose Push an existing local repository to GitHub
  3. Press Enter
  4. Press Enter
  5. Press Enter
  6. Observe the description entered in step 6. is the repository name.

Expected vs actual behavior

Actual behavior: description defaults to repository name

➜  foo git:(main) gh repo create
? What would you like to do? Push an existing local repository to GitHub
? Path to local repository .
? Repository name foo
? Description (foo)

Expected behavior: description defaults to empty

➜  foo git:(main) gh repo create
? What would you like to do? Push an existing local repository to GitHub
? Path to local repository .
? Repository name foo
? Description

Also compare this to the behavior when creating a new repository from scratch, where the description defaults to empty.

➜  foo gh repo create
? What would you like to do? Create a new repository on GitHub from scratch
? Repository name bar
? Description

Logs

gh version 2.27.0 (2023-04-07)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions welcomepriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions