A simple Beginner`s tutorial on how to install Git, connect to GitHub, and use basic Git workflows
New to tech? Don't worry. I will take you through a simple step by step guide to help you install Git, connect it to GitHub, and use basic git commands that will help your new journey and boost your understanding. I started my Data analytics, science and AI journey early this week at LUX DEV HQ on 12/01/2026 and I am happy to share my journey here.
Table of contents
- Overview
- Install Git (Windows / macOS / Linux)
- Configure Git identity
- Create a GitHub account and connect (SSH recommended)
- Create, commit, push, and pull (basic workflow)
- Inspecting history and tracking changes
- Undoing changes (safe commands)
- Simple teamwork workflow (feature branches + pull requests)
- Quick cheat-sheet you can use later
Overview
Git saves snapshots of your project so you can track changes, collaborate, and revert mistakes. GitHub stores repositories online so you can share code.
Install Git
Windows
- Download the installer: https://git-scm.com/download/win
- Run the installer and accept the default options.
Open Git Bash from the Start menu and verify:
Windows
- Open Terminal and run:
git --version
macOS
- Open Terminal and run:
git --versionIf not installed, macOS will prompt to install the Xcode command line tools — accept to install. Alternatively download: https://git-scm.com/download/mac
Linux (Ubuntu/Debian)
- Open Terminal and run:
sudo apt update sudo apt install git -y git --version
Configure Git identity
Run these once (replace with your name and email):
git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Check your settings:
git config --list
Create a GitHub account and connect Git to GitHub (SSH recommended)
Create a GitHub account
- Go to https://github.com and sign up.
Generate an SSH key (recommended)
- In Git Bash:
ssh-keygen -t ed25519 -C "you@example.com"

If ed25519 is unavailable, use:
ssh-keygen -t rsa -b 4096 -C "you@example.com"
Press Enter to accept defaults and optionally set a passphrase.
- Start the ssh-agent and add your key:
macOS / Linux:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
Windows (Git Bash): Copy the path where your path was saved
eval "$(ssh-agent -s)"
ssh-add //c/Users/Administrator/.ssh/id_ed25519
- Copy the public key to your clipboard:
macOS:
pbcopy < ~/.ssh/id_ed25519.pub
Linux (with xclip):
xclip -sel clip < ~/.ssh/id_ed25519.pub
Windows (Git Bash):
cat ~/.ssh/id_ed25519.pub | clip
- On GitHub: Settings → SSH and GPG keys → New SSH key → paste the key → Save.
- Test the connection:
ssh -T git@github.comYou should see a welcome message confirming authentication.
Basic Git workflow (create, track, commit, push, pull)
Create a local repository and make your first commit
Create a project folder and initialize Git:
mkdir my-project
cd my-project
git init
This creates a .git folder that tracks changes.

Add files and make first commit
Create a file (example):
echo "# My Project" > README.md
Check repository status:
git status
Stage files:
git add README.md
To stage everything:
git add .
Commit staged files with a message:
git commit -m "Add README"
Link the local repo to GitHub (push)
On GitHub: click New repository, name it (for example: my-project), and copy the SSH URL:
git@github.com:username/my-project.gitLink remote and push:
git remote add origin git@github.com:username/my-project.git
git branch -M main
git push -u origin main
For HTTPS use the HTTPS URL instead:
https://github.com/username/my-project.git
- Push your main branch:
`
git branch -M main
git push -u origin main
`
Pull changes from remote
To fetch and merge remote changes into your current branch:
git pull
Understand version control basics
Key concepts:
- Repository: a project with its history.
- Working directory: your current files.
- Staging area (index): files you marked to include in next commit.
- Commit: a saved snapshot with a message and ID.
- Branch: a parallel line of development (main is default).
- Remote: an online copy (e.g., GitHub).
- Push: send commits to remote.
- Pull: fetch remote commits and merge into local branch.














Top comments (0)