Push commits with repo creation using Github CLI
When creating a GitHub repo with the CLI tool, you have the opportunity to push up your commits immediately as well using the --push
or (-p
)
❯ gh repo create OWNER/REPO --push --source .
✓ Created repository OWNER/REPO on GitHub
✓ Added remote git@github.com:OWNER/REPO.git
Using the push flag requires the --source
flag to tell it where the repo is locally which is why you see that in the example above.