/usr/share/doc/git
The Complete Git & GitHub Guide
IN PROGRESS — 40 of 75 chapters published; more on the way
- CHAPTERS
- 75
- WRITTEN
- 40
- PARTS
- 11
- PROGRESS
- 53%
A guide that teaches Git and GitHub step by step from the basics, even if you’ve never touched them before. 75 pages in 11 parts.
Git is software that records the change history of your files on your own PC. GitHub is a service for storing that history on the internet and sharing it with others. The names are similar, but they’re different things. This guide keeps the two separate, covering Git first and GitHub after.
Even if you’re someone who “pushes without really knowing what’s going on,” there’s material here that goes beyond the basics, from how Git works internally to how teams use it.
Before you start reading#
If you’re new, read in order starting from Part 1, #01 (Introduction: How to Read This Guide). It gives you a map of the whole guide and shows where to start reading depending on your goal.
If you’ve come here to look something up because you’re stuck, go straight to Part 11, #73 (Troubleshooting Index).
Git (Parts 1–5, 35 pages)#
How Git works and how to use it. Parts 2 through 5 take place entirely on your own PC; no internet connection is needed.
GitHub (Parts 6–11, 40 pages)#
Storing your local Git history on GitHub and working with other people.
PART 01Introduction — The Big Picture
Understand the difference between Git and GitHub, and set up your account. Everyone should read this part.
PART 02Git Basics — Working Locally
Learn to record and restore changes using only your own computer. Be sure to follow along hands-on.
- 06Installing and Configuring Git
- 07Creating a Repository (git init)
- 08Git’s Three Areas
- 09add and commit
- 10Checking Where You Are with status and diff
- 11Reading History with log
- 12Excluding Files with .gitignore
- 13Moving, Deleting, and Untracking Files
- 14Undoing Things, Part 1 (restore, reset, amend)
- 15Undoing Things, Part 2 (revert, reflog)
PART 03Git Internals — Why It Works the Way It Does
Explain what commands do by understanding the mechanics, not by memorizing. Skimming is fine on a first read.
PART 04Branches and Merging
Learn to branch off your work and merge it back safely.
- 21What Is a Branch
- 22Creating, Switching, and Deleting Branches
- 23How Merging Works (Fast-Forward and Three-Way)
- 24Resolving Conflicts
- 25Understanding rebase
- 26Cleaning Up History with Interactive Rebase
- 27Picking Specific Commits with cherry-pick
- 28Branching Strategies (GitHub Flow / Git Flow / Trunk-Based)
PART 05Practical Git Techniques
Assemble the real-world toolkit: stash, bisect, hooks, and more.
PART 06Connecting to GitHub
Push your local history to the cloud and pull it back down. This is where the internet first comes in.
- 36The Idea of a Remote Repository
- 37Authenticating (HTTPS + PAT / SSH)Writing
- 38Creating a Repository on GitHubWriting
- 39Uploading with push
- 40Downloading with clone, fetch, and pull
- 41Understanding Tracking Branches (Upstream)
- 42Putting an Existing Project on GitHub
PART 07Collaborating on GitHub
Use issues and pull requests to build software together with others.
- 43Issues: Making Work VisibleWriting
- 44Labels, Milestones, and TemplatesWriting
- 45Creating a Pull RequestWriting
- 46Code Review in PracticeWriting
- 47Branch Protection and Merge MethodsWriting
- 48Forking and Contributing to Open SourceWriting
- 49Organizations and Team PermissionsWriting
- 50Tracking Progress with ProjectsWriting
- 51CODEOWNERS, Discussions, and WikiWriting
PART 08Making the Most of GitHub
Master the features around your repository: README, licenses, Pages, and more.
- 52Writing a READMEWriting
- 53GitHub Markdown and GistsWriting
- 54Choosing a LicenseWriting
- 55Shipping Versions with Releases and TagsWriting
- 56Publishing with GitHub PagesWriting
- 57Security Features (Dependabot / Secret Scanning / CodeQL)Writing
- 58Search, Stars, Watching, and InsightsWriting
PART 09GitHub Actions — Automation
Automate testing and deployment.
- 59CI/CD and GitHub Actions BasicsWriting
- 60Writing Workflow YAMLWriting
- 61Handling Secrets and VariablesWriting
- 62Practical RecipesWriting
- 63Marketplace and Reusable WorkflowsWriting
- 64Pricing and Run TimeWriting
PART 10Working Smarter with Tools
Speed up your daily work with GUI and CLI tools.
- 65Git in VS CodeWriting
- 66GitHub DesktopWriting
- 67GitHub CLI (gh)Writing
- 68Customizing Your Setup (config / alias / diff tools)Writing
- 69Working with AI (Copilot / Claude Code)Writing
PART 11Practice and Quick Answers
Build real workflows and learn to recover from trouble on your own.
- 70Case 1: A Solo Developer WorkflowWriting
- 71Case 2: A Small Team WorkflowWriting
- 72Case 3: Managing Documents and Settings as a Non-EngineerWriting
- 73Troubleshooting: Quick AnswersWriting
- 74Command Cheat SheetWriting
- 75Where to Go from HereWriting