Getting Started with Git & GitHub
Welcome to Git & GitHub
Git is a version control system that tracks changes to your code over time. GitHub is a platform built on top of Git that hosts your code online and adds collaboration features like pull requests, issues, and code review.
Together, they're the foundation of how software teams work — from solo developers to teams of thousands.
Why Learn Git?
- Never lose work — every change is tracked and reversible
- Work in parallel — branches let you build features without breaking existing code
- Collaborate without conflicts — Git intelligently merges work from multiple people
- Industry standard — used by virtually every software company on the planet
- Understand your project's history — who changed what, why, and when
What You'll Learn
Basics
- What Git is and how it works
- Pushing your code to GitHub
- Adding collaborators to a project
- Understanding
.gitignore - Creating Pull Requests — the core collaboration workflow
Advanced
- Writing clean commit messages
- Working with branches
- Reading commit history
- Rebasing vs merging
- Git stashing
- Resolving merge conflicts
- Tags and releases
- GitHub Actions (automated CI/CD)
Prerequisites
- A computer with internet access
- A GitHub account (free)
- Git installed — download from git-scm.com
Verify Git is installed:
git --version
# git version 2.x.x
Essential Git Commands Cheatsheet
# Setup (do this once)
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
# Start a project
git init # initialize a new repo
git clone <url> # clone an existing repo
# Daily workflow
git status # see what's changed
git add . # stage all changes
git add <file> # stage a specific file
git commit -m "message" # commit staged changes
git push # push to remote
git pull # pull latest changes
# Branches
git checkout -b feature/x # create and switch to new branch
git checkout main # switch back to main
git merge feature/x # merge branch into current
# History
git log --oneline # compact commit history
git diff # see unstaged changes
Learn by doing
The fastest way to learn Git is to use it on a real project. Even a personal project where you're the only contributor will teach you the core workflow quickly. Start with init, add, commit, and push — master those before moving to branches.