How to Install & Configure Git

Git is a free and open-source version control system used to handle small to very large projects efficiently.
It is used to track changes in the source code, enabling multiple developers to work together on non-linear development. 

It has a version control system (VCS) that makes it easier to track and manage the changes to the code submitted by various team members, and in turn, accelerates the software development and testing process.

Some of the notable benefits of using a version control system include:

  • Access to long-term change history so you can view every change that’s ever been made to a file by the team.
  • Branching and merging, which facilitates simultaneous contribution and allows you to merge multiple versions of a file into a single file to apply the changes and prevent file duplication.

This tutorial will guide on how to install & configure git on centos7 :-

NOTE: The mentioned steps are performed on CentOS 7 server.

STEP 1: Install Git on your machine.

First, we’ve got to install the ‘git’ package on the provisioned CentOS 7 system, which is done using the ‘yum’ package management system and the default configured repositories.

sudo yum -y install git

STEP 2: Configure Git

Once you’ve installed Git on your system, you need to configure some of its components before you can use it, such as the username, email address, and the default text editor.

Now, we will create the Global Configuration File for Git.

git config --global user.name "Your_name" 
git config --global user.email "Your_email_address" 
git config --global core.editor "/usr/bin/vim"

STEP 3: Review the configurations

Once you have configured Git to your preferences, check the configuration settings once to ensure they’re correct. Run the following command to get a list of all the Git configuration settings for your system:

git config --list

This outputs each setting on a line:

user.name=Your_name
user.email=Your_email_address
core.editor=/usr/bin/vim

Instead, we could run:

cat ~/.gitconfig

This just reads and outputs the file itself:

[user]
        name = Your_name
        email = Your_email_address
[core]
        editor = /usr/bin/vim

Click here for the tutorial on How to configure ssh keys on github

Leave a Reply

Your email address will not be published. Required fields are marked *