Git and GitHub for Beginners: A Friendly Guide

Published: (January 17, 2026 at 03:37 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Installing Git Bash

  • Google Git Bash
  • Download the Windows installer
  • Run the installer with these recommended settings:
    • Select “Use Git from Git Bash only”

Connecting Git to Your GitHub Account

Check Git version

git --version

Configure Your Identity

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Generate an SSH Key

# Generate a new SSH key
ssh-keygen -t ed25519 -C "you@example.com"

The public key will be saved to:

C:\Users\YOUR_USERNAME\.ssh\id_ed25519.pub

Add SSH Key to GitHub

  1. Go to your GitHub account → Settings → SSH and GPG keys.
  2. Click “New SSH key”, paste the contents of id_ed25519.pub, and save.

Test Your Connection

ssh -T git@github.com

You should see a success message confirming authentication.

What Is Git and Why Is Version Control Important?

Git is a free, open‑source distributed version control system (DVCS) used by developers to track changes in source code and other files during software development. It enables multiple people to collaborate on the same project without overwriting each other’s work and allows users to revert to previous versions when needed.

Importance of Version Control

  • Keeps a complete history of changes.
  • Facilitates collaboration among team members.
  • Enables branching and merging for feature development.
  • Provides a safety net for recovering lost work.

How to Push Code to GitHub

# Initialize a new repository (if you haven’t already)
git init

# Add your files to Git’s staging area
git add .

# Commit your changes with a message
git commit -m "Initial commit"

# Connect your project to GitHub
git remote add origin https://github.com/username/repository.git

# Push your code to the remote repository
git push -u origin main

How to Pull Code from GitHub

Pulling downloads the latest changes from GitHub to your local machine:

git pull origin main

How to Track Changes Using Git

  • Status: Shows which files are new, modified, or staged.

    git status
  • Log: View commit history with messages, authors, and timestamps.

    git log
  • Diff: Compare changes before committing; displays the exact lines added or removed.

    git diff
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...

Git Essentials for Beginners

Overview This guide introduces beginners to the core concepts of Git, the leading version control system. You’ll learn what version control is, why it matters,...