# The Git Guide

> Learn Git and GitHub from zero: setup, branches, remotes, pull requests, and fixing mistakes. A curated path through the best Git tutorials.

Author: Flavio Copes | Published: 2018-02-27 | Updated: 2026-07-14 | Canonical: https://flaviocopes.com/git/

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:

1. [How to set up Git and GitHub from Zero](https://flaviocopes.com/github-setup-from-zero/) gets you from nothing to your first repository
2. [A developer's introduction to GitHub](https://flaviocopes.com/github/) explains the platform where most Git collaboration happens
3. [How to setup the Git SSH keys](https://flaviocopes.com/how-to-setup-git-ssh-keys/) so you can push without typing passwords
4. [How to make your first Pull Request on GitHub](https://flaviocopes.com/how-to-make-first-github-pull-request/) walks you through your first open source contribution
5. [A Git Cheat Sheet](https://flaviocopes.com/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](https://flaviocopes.com/git-workflow/)
- [How to update a Git branch from another branch](https://flaviocopes.com/how-to-git-update-branch/)
- [Squashing Git commits](https://flaviocopes.com/git-squash/)
- [How to add a Git remote](https://flaviocopes.com/git-add-remote/)
- [How to remove a Git remote](https://flaviocopes.com/git-remove-remote/)
- [Push to 2 Git repositories at once and keep them in sync](https://flaviocopes.com/how-to-push-two-repositories-sync/)

## Authentication and credentials

GitHub removed password authentication a while ago, and credential setup is a common source of confusion:

- [How to authenticate to GitHub using username and password](https://flaviocopes.com/github-auth-username-password/)
- [How to set GitHub credentials for macOS](https://flaviocopes.com/setup-github-credentials-macos/)

## When things go wrong

Everyone breaks something eventually. These posts help you recover:

- [I posted my password / API key on GitHub](https://flaviocopes.com/git-secrets/) tells you what to do right now if it happens
- [How to discover a bug using git bisect](https://flaviocopes.com/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](https://flaviocopes.com/git-submodules-publish-github/)
- [Trigger deploys on Netlify with submodules](https://flaviocopes.com/netlify-deploy-git-submodule-github-actions/)

## Go deeper

For a compact reference you can keep at hand, download the free [Git Cheat Sheet](https://flaviocopes.com/ebooks/git-cheat-sheet/).

If you want the full structured path, from your first commit to rebasing with confidence, that's what the [Git Masterclass](https://flaviocopes.com/courses/git) is for.

Everything I wrote about Git lives in [the git tag](https://flaviocopes.com/tags/git/).
