Skip to content

gh repo create --add-readme does not clone remote branches #7836

@Shion1305

Description

@Shion1305

Describe the bug

When using gh repo create with readme creation enabled, main branch will be automatically created on repository creation. However, if you clone repository on the end of the command, main branch does not exist on local branches, which is not expected behavior.

Steps to reproduce the behavior

  1. Run gh repo create
  2. Select Create a new repository on GitHub from scratch
  3. Type repository name, owner, description and visibility.
  4. Answer "y" to Would you like to add a README file?
  5. Answer "n" to Would you like to add a .gitignore?
  6. Answer "n" to Would you like to add a license?
  7. Answer "y" to This will create (repository name) as a public repository on GitHub. Continue?
  8. Answer "y" to Clone the new repository locally?

Expected vs actual behavior

Expected

Main branch with README file should exist on local.

Actual Behavior

No branch exist on local.

Logs

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions welcomep3Affects 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