Getting Started with Git and GitHub: A Beginner's Guide

Published: (January 18, 2026 at 05:10 AM EST)
2 min read
Source: Dev.to

Source: Dev.to

Introduction

In the world of software development, version control is essential. Git is a version control tool that helps you track changes in your code, while GitHub allows for collaboration and showcases your projects. This guide walks through setting up Git Bash, connecting it to your GitHub account, and the basics of pushing and pulling code.

What is Git Bash?

Git Bash provides a Unix‑like terminal on Windows, giving you access to Git commands and common Bash utilities.

What is GitHub?

GitHub is a cloud‑based platform for hosting Git repositories, enabling collaboration, issue tracking, and project showcase.

Why Use Git and GitHub?

  • Version Control – Track changes to your code over time.
  • Collaboration – Work with others seamlessly.
  • Portfolio – Showcase your projects to potential employers.

Installing Git Bash

  1. Select your operating system on the official Git website.
  2. Download and run the installer.

Verifying Installation

git --version

Configuring Name and Email

# Set your name
git config --global user.name "YourName"

# Set your email
git config --global user.email "YourEmail"

# Verify the configuration
git config --list

Connecting GitHub to Git Bash Using SSH Keys

Generate an SSH Key

# List existing keys (optional)
ls ~/.ssh

# Generate a new Ed25519 key
ssh-keygen -t ed25519 -C "YourEmail"

# Start the ssh-agent
eval "$(ssh-agent -s)"

# Add the private key to the agent
ssh-add ~/.ssh/id_ed25519

Add the SSH Key to GitHub

# Copy the public key to the clipboard (Windows)
clip < ~/.ssh/id_ed25519.pub
  1. Go to GitHub → Settings → SSH and GPG keys → New SSH key.
  2. Paste the copied public key, give it a title (e.g., “GitHub Key”), and click Add SSH key.

Test Your Connection

ssh -T git@github.com

You should see a success message confirming authentication.

Basic Git Commands

# Create a new directory and initialize a repository
mkdir kenya
cd kenya
git init

# Create files
touch nairobi
touch student.py
touch README.md

# Stage all changes
git add .

# (Optional) Return to home directory
cd ~

Conclusion

Mastering Git and Git Bash is essential for effective version control and collaboration in software development. By understanding these basic commands and configuring SSH authentication, you can efficiently manage your projects and contribute to others’ work on platforms like GitHub.

Back to Blog

Related posts

Read more »

Getting started with Git and GitHub.

Exploring new learning curves and opportunities isn’t something I thought I would ever do in 2026. In this post I share the lessons I learned during the first w...

A NEWBIE'S GUIDE TO GIT(gitbash).

markdown !Githttps://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com...