Home Configuring Git for the first time
Post
Cancel

Configuring Git for the first time

Installing Git Setup

Choose your operating system and download the Git setup from official website here. After download follow the steps and install it.

Don’t change any options, let it be on default.

If you are planning to first learn only Git and later on GitHub, you can skip below steps. We will be connecting Git and GitHub for pushing our code on GitHub.

Get GitHub Account

  • Go to GitHub site and sign up with a new email ID and create your account.

  • If you have account on GitHub already login and follow the steps below.

Generating SSH Keys

  • Read the information carefully and then only use the commands.

Set Username

  • Enter the below command and replace the text within the quotes with your GitHub username or whatever you wish your username to be.
1
git config --global user.name “Enter your username here”

Set Email ID

  • Enter your email ID within the quotes and press ENTER.
1
git config --global user.email “Enter your email here”

SSH Key

  • Type the command to check if theres existing SSH Key on the system.
1
ls -al ~/.ss

Get New SSH Key

  • Enter the command to generate new SSH Key for the system, if there’s no key aleardy existing. Replace the text within quotes with your email ID. Press ENTER till the end.
1
ssh-keygen -t ed25519 -C "your_email@example.com"

Copy the SSH Key

  • It is used to check pid of the SSH Keys.
1
eval "$(ssh-agent -s)"
  • It is used to view the SSH Keys on terminal and copy it.
1
tail ~/.ssh/id_ed25519.pub

Connect SSH Key

  • Go to GitHub profile and open settings.

  • Under settings go to SSH and GPG Keys.

  • Add the SSH Key which we copied from Git Bash terminal.

  • Verify your GitHub Email ID and you are done.

Your account is now linked with your GitHub profile and now you are ready for using git and open source projects.

This post is licensed under CC BY 4.0 by the author.

Git and GitHub Introduction

Basic Git Commands