Package Managers gave BookNest its dependencies; this chapter gives it a memory. Git 1,932 records every version of every file, tells you who changed what and why, lets you try an idea on a branch and throw it away, and recovers work you thought you had destroyed. Everything later in this book starts from a Git repository: GitHub Actions 29 runs on a push (GitHub), Docker 514 builds from a checkout (Docker), Jenkins 8,793 polls a branch (Jenkins), Argo CD 126 syncs a cluster from a commit (Kubernetes), and CloudFormation 24 templates live beside the code they deploy (AWS CloudFormation).
The chapter uses Git 2.55.0 in Ubuntu 26.04 225 under WSL2 6 , and every line of output was produced by running the command shown. It is host-neutral: a Git repository is complete on your own disk, so nothing here needs a server; pull requests and other hosted features belong to GitHub. The Object Model opens the hood before you drive, and in First Repository you create BookNest's repository, whose history grows through the rest of the chapter.
What you will learn:
Installing and configuring Git, line endings and credentials
How blobs, trees, commits, refs, the index and packfiles work
Staging, committing, and reading history and diffs
Branching, merging, rebasing and resolving conflicts
Remotes, tags, stashes, worktrees, bisect and the reflog
Submodules, subtrees, hooks, Git LFS 127,865 and big-repository tools
Signed commits, team workflows, commit conventions and aliases
How the command line compares with Git GUIs and terminal tools
Sections
- Installing and Configuring Git
- The Object Model
- First Repository
- Branching and Merging
- Rebase and Conflicts
- Working with Remotes
- Tags and Releases
- Stash, Worktrees and Bisect
- Reflog and Recovery
- Submodules and Subtrees
- Git Hooks and Automated Checks
- Large Files and Big Repos
- Signing Commits
- Workflows and Conventions
- Configuration and Aliases
- GUIs and Terminal Tools
- Test Yourself!