Today I Learned

hashrocket A Hashrocket project

Create remote with repo creation using GitHub CLI

If you have not partaken, creating a GitHub repo with the CLI tool is pretty cool; however, one thing that always got me was that when you create a new repo it does not create a remote so I'd always have to go back and make an origin.

There is an additional CLI flag that you can pass to do this for you.

gh repo create OWNER/REPO -r origin -s .

So, just for context, the -r (or --remote) flag is for naming the remote. This must also be used with the -s (or --source) flag, which tells the CLI where the repo lives on your local system. In the above example, I referenced the directory I was in using a ..

See More #git TILs