Is there any git command/script to create new GitHub repository from CLI?

| improve this question | | | | |

This is one way to do it (change REPO and USERNAME):

curl -d '{"name": "REPO"}' -u USERNAME https://api.github.com/user/repos

If you are using two factor auth, you'll also need to add this as part of the curl invocation:

-H X-GitHub-OTP:123456

Replace 123456 with the current 2FA value from your token generator (you'll need to be quick).

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.