Github git setup

In this blog post, I am writing how you can set up git a version control system in your computer system and connect and authenticate it with github.

open terminal and check if git is already installed

git --version

if it is already installed, git version will be the output:

git version 2.5.0

If not installed Download and install git from -you will find the command for your distro accordingly, some common are listed here:


yum install git


dnf install git


apt-get install git

If git is already installed we can get/update latest version of git by git itself

git clone

Setting Git username

In terminal, lets setup username

git config --global "username"

This will be written in a file /.gitconfig

You can check username with

git config --global

Setting email address

in terminal add your github email address

git config --global "[email protected]"

confirm by

git config --global

note: we are adding username and email address for every repository on our computer

Authenticating with GitHub from Git

There are two ways to connect with Github from our computer with git.

  1. With HTTPS
  2. With ssh

Here I am explaining about the HTTPS

We can push/commit/pull or do any operations on our github repo.

  • go to
  • create a new repository

in terminal,

Initialize git

git init

add the changes

git add .

commit changes

git commit -m "your message"

add remote by

git remote add origin

we can get origin address in repo’s setting too while creating repo

after adding origin,we are ready to push to github

git push -u origin master