Skip to Content
DevopsGitGit Setup

Git Setup

Before using Git, you need to install it on your system and configure some basic settings such as your name and email. These details will be attached to every commit you make.


1. Install Git

Download and install Git from the official website: git 

Git is available for:


After installation, verify that Git is installed correctly by running:

terminal
git --version

You should see something like:

git version 2.x.x

2. Configure Your Identity

Git requires a username and email to identify who made each commit.

Run the following commands in your terminal:

Terminal
git config --global user.name "Your Name" git config --global user.email "your@email.com"

The --global flag means this configuration will apply to all repositories on your computer.

3. Check Your Configuration

To see your current Git configuration, run:

Terminal
git config --list

This will display your Git settings, including your username and email.

  • user.name=Your Name
  • user.email=your@email.com

4. Default Branch Name (Optional)

You can define the default branch name for new repositories:

terminal
git config --global init.defaultBranch main

This ensures that newly created repositories start with the main branch instead of master.

Last updated on