Git & GitHub
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production; see the section bibliography for the reference material consulted while preparing these pages. |
Git is the distributed version-control tool that tracks every change to a project’s files as a graph of
snapshots; GitHub is a hosting and collaboration platform built around Git repositories, adding pull requests,
issues, code review, Actions and a web UI on top of the same underlying Git history. This section teaches the
day-to-day Git and GitHub workflow — repositories, commits, branches, tags, checkout/switch/restore, fetch/pull/push,
merging and pull requests — explaining each concept, then showing the same operation four ways: the command line (git, and
gh where relevant), GitHub.com, IntelliJ IDEA and VS Code. The examples are written and verified
against Git 2.55.x, GitHub CLI 2.101.x, IntelliJ IDEA 2026.2, current stable VS Code with the GitHub Pull Requests
and Issues extension, and github.com as of September 2026, with main as the default branch throughout.
New here? Read in this order: Getting Started with Git and GitHub, then Repositories and Cloning, Commits and Branches; next Checkout, Switch and Restore and Fetch, Pull and Push; then Merging, Rebasing and Conflicts and Pull Requests; and finally Tags and Releases.
What’s covered
Foundations
-
Getting Started with Git and GitHub — version control and why Git is distributed, Git versus GitHub, installing Git, first-time setup, authenticating with HTTPS or SSH, and IDE setup in IntelliJ IDEA and VS Code.
-
Repositories and Cloning — the
.gitdirectory and the three areas (working tree, staging area, repository),git initversusgit clone,.gitignore, remotes, and creating, cloning or forking a repository.
Everyday work
-
Commits — what a commit is, staging and committing, writing good commit messages, inspecting history, and amending, restoring, reverting and resetting.
-
Branches — branches as movable pointers, the branch commands, local versus remote-tracking branches, and GitHub flow versus a Git-flow-style workflow.
-
Checkout, Switch and Restore — how
git checkout’s two jobs became `git switchandgit restore, detachedHEAD, and switching with uncommitted changes. -
Tags and Releases — tags as fixed pointers, lightweight versus annotated tags, and GitHub releases built on tags.
Collaborating
-
Fetch, Pull and Push — moving commits between a local repository and
origin, rejected non-fast-forward pushes, and--force-with-leaseversus--force. -
Merging, Rebasing and Conflicts — fast-forward and three-way merges, resolving merge conflicts, and
git rebase. -
Pull Requests — proposing, reviewing and merging changes with pull requests, on github.com, with the GitHub CLI, in IntelliJ IDEA and in VS Code.
Reference
-
Git & GitHub Cheat Sheet — a one-page, printable summary of the whole section, with a downloadable PDF.
Once a branch is pushed, what happens next is usually a CI/CD pipeline: see Docker CI/CD with GitHub Actions and React Native CI/CD and Over-the-Air Updates for how pushes, tags and pull requests trigger GitHub Actions workflows in this account’s projects.
Bibliography
-
Chacon, Scott; Straub, Ben. Pro Git. 2nd ed., Apress, 2014 — free online at git-scm.com/book (the primary conceptual source for this section; also available in print, publisher page).
-
git-scm.com — Reference manual and the full command reference.
-
GitHub Docs — Get started, Repositories, and Pull requests.
Every page in this section links to the specific official page each step list or command is derived from; where
this bibliography and a concept page’s own == References section ever appear to disagree, the official
documentation linked from the concept page wins.