The Git Guide
By Flavio Copes
Learn Git and GitHub from zero: setup, branches, remotes, pull requests, and fixing mistakes. A curated path through the best Git tutorials.
Git is a version control system. It tracks every change you make to your code, so you can roll back mistakes, work on multiple things at once, and collaborate with other people without stepping on each other’s toes.
You can’t avoid Git as a developer. Every job, every open source project, every side project runs on it.
The good news: you only need a small set of commands to be productive. This page is your starting point for Git on this site, with a path through the best posts I wrote on the topic.
Where to start
If you’re new, follow these in order:
- How to set up Git and GitHub from Zero gets you from nothing to your first repository
- A developer’s introduction to GitHub explains the platform where most Git collaboration happens
- How to setup the Git SSH keys so you can push without typing passwords
- How to make your first Pull Request on GitHub walks you through your first open source contribution
- A Git Cheat Sheet is the reference to keep open while you work
Working with branches and remotes
Branches are where Git gets powerful. These posts cover the daily workflow:
- Git workflow to manage work on multiple branches
- How to update a Git branch from another branch
- Squashing Git commits
- How to add a Git remote
- How to remove a Git remote
- Push to 2 Git repositories at once and keep them in sync
Authentication and credentials
GitHub removed password authentication a while ago, and credential setup is a common source of confusion:
When things go wrong
Everyone breaks something eventually. These posts help you recover:
- I posted my password / API key on GitHub tells you what to do right now if it happens
- How to discover a bug using git bisect finds the exact commit that broke your code
Advanced topics
Once you’re comfortable, submodules let you nest repositories inside each other:
- Using git submodules to have a portion of a website public
- Trigger deploys on Netlify with submodules
Go deeper
For a compact reference you can keep at hand, download the free Git Cheat Sheet.
If you want the full structured path, from your first commit to rebasing with confidence, that’s what the Git Masterclass is for.
Everything I wrote about Git lives in the git tag.
Related posts about git: