Set Up GIT to Push Projects To GitHub

In this tutorial, We will set up our GIT to push our projects to GitHub.

We will go through the following steps:

  1. Generate GitHub Access Token
  2. Download and Install GIT
  3. Configure GIT

Step 1. Log in to GitHub and Generate Access Token:

This step is pretty self-explanatory. Firstly, we need to create a GitHub account. So go ahead and Sign up if don’t have a GitHub account. After the registration process Log In to your account. Go to settings.

GitHub Settings
GitHub Settings

Scroll down to the Developer settings

GitHub Developers Settings
GitHub Developers Settings

Go to Fine-grained tokens under Personal access tokens

GitHub Fine-grained tokens
GitHub Fine-grained tokens

Hit Generate new token, this might ask you for your password, enter and proceed.

Now it will ask you for a token name and Expiration. You can choose anything as you see fit.

GitHub Token Generation I
Token Generation I

I have selected All repositories since we don’t want to access all the repo. Now click on Repository permissions and give permission to Read and write to Contents, Pull requests, and hit Generate New Token

Granting permission on GitHub
Granting permission on GitHub

Now you will get an access token. Make sure to save it somewhere safe. Don’t share it with anyone.

Generated Access Token
Generated Access Token

 

and we are done with the first portion of the tutorial.

 

Step 2: Download and Install GIT

It’s time to Download GIT on our system. Go to GIT -Downloads, choose and download the suitable application for your system. Install it. I’m not covering the installation part as it is super easy to do.

Note: Make sure to tick the Add to Path checkbox while installing it.

 

Step 3: Configure GIT

To make sure that you’ve successfully installed it, run git on your command prompt.

Running git commands
Running git commands

If you see something similar to this you’re good to go. Look into Stackoverflow if you see the following error:

‘git’ is not recognized as an internal or external command,
operable program or batch file.

If you successfully installed git, we are almost done. Now run the following command:

git config –global github.token YOUR_API_KEY

Replace it with your Access Token. Voila, now we are done.

Now you are set to push and pull projects to and from GH.

Leave a Reply