Git – Environment Setup

Setting up your environment for Git is an important step for effective version control in your software development projects. This guide will walk you through the process of installing and configuring Git on various operating systems, ensuring you’re ready to manage your code efficiently.

What is Git?

Git is an open-source, distributed version control system used to track and manage changes within a code repository. It was developed by Linus Torvalds in 2005. Before using Git, we have to install and set it up for our use. Here is how it goes.

Steps for Git Environment Setup

Step 1. Go to git-scm.com/downloads and download as per your system.

git-scm/download webpage

Step 2. If you are using Debian-based GNU/Linux distribution, all you have to do is command sudo apt-get install git-core.

Step 3. Whatever command line you are using, enter “git —version” if it gives back the Git version you are ready to go.

git version check

Setting Git Environment

Git has a git config tool, which allows us to set configuration variables. Git stores all the global configurations in a .gitconfig file, which is located in our home directory. To set these configuration values as global, add the –global option, and if you omit the –global option, then our configurations are specific for the current Git repository.

Setting username

This is for customizing our username, which will tell who is working on the repositories.

setting git username

Setting email id

This is for setting our email, which makes our identity as a creator of the repositories.

Setting email id

List of Git config

To verify our Git settings of the local repository, use the git config –list command as given below.

List of Git config