You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh repo create prevents empty description when pushing an existing local repository #7377
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
Run gh repo create in a new git repository
Choose Push an existing local repository to GitHub
Press Enter
Press Enter
Press Enter
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
changed the title [-]`gh repo create` defaults to repository name for empty description when pushing an existing local repository[/-][+]`gh repo create` prevents empty description when pushing an existing local repository[/+]on Apr 27, 2023
Digging around a bit, it seems the repository name as default description when creating from a local repository is set in the call prompter.Input("Description", defaultName) in /pkg/cmd/repo/create/create.go#LL733.
Activity
[-]`gh repo create` defaults to repository name for empty description when pushing an existing local repository[/-][+]`gh repo create` prevents empty description when pushing an existing local repository[/+]vwkd commentedon Apr 30, 2023
Digging around a bit, it seems the repository name as default description when creating from a local repository is set in the call
prompter.Input("Description", defaultName)in /pkg/cmd/repo/create/create.go#LL733.