Add An Existing Repo to Github via CLI

If you’d like to push an already existing git repository to github then you can easily create the repository from the cli and begin the foundations of interacting with remote repos programmatically. First, you need a personal access token and if you do not yet have one then perform the following:

  • Access your github account settings
    • Developer Settings
    • Personal access tokens
      • Generate new token

Be sure to save/download the token, as you will be unable to access it in the future. Once the token has been generated use it in the following curl command to create the desired repo replacing <name> with the desired repo name:

[Read More]
github  cli  curl