How to use github in the terminal (github-cli)

Using github in website is fine,but in the terminal it's cool. In this blog I going to tell you how you can use github in the terminal.

First, you need to install git and github-cli in your pc. So:

Once those are installed, it time to configuire git global informations. Now copy paste bellow 2 commands in the terminal replacing "name" and "email" to your actual github account name and email inside the quotation mark.
  1. git config --global user.name "name"
  2. git config --global user.email "email"
To check if name and email is configuired correcly, type:

Once configuration file is done, move to the directory, that you want to upload as github repository.
There type: git init to initialize git in that folder. Now, type:

Now select GitHub.com >> HTTPS >> Login with a web browser. If you have done everything correctly, you should see something like this.

GitHub-cli

Copy or remember that 8 digit code, then press enter to continue in a browser session. Do accordingly as the GitHub website says to connect to the github.com. Once everything is done, you should see something like this: GitHub-cli-confirmation If you see you github id name in the logged in as section, you are all set. To verify that, type:  gh auth status

Now you are logged in inside the termianl to your github web. Move to the directory which you want to upload to the github. There at first you need to initialize git.

This will initialize git in your local repository. Now, we first need to create a repository in our github account. Copy this command and replace repo_name with the directorty name you are working on or the name you want to create a new repository. This will create a repository named repo_name in your github account. You can check that by viewing your account in the browser, or you can trust me.
Now we need to add this repository in our remote repository section of git local. For that, Now, it's time to push your local repository. Type these four commands accordingly,

Congratulations! You have successfully uploaded your code to github web accout usigng just the terminal.