Skip to content
2 Git & GitHub PDF ebooks · one purchase

Git & GitHub, from your first commit to CI/CD and open source.

Get both: Git & GitHub: The Complete Guide (123 pages, 21 chapters, beginner to advanced), with every command shown with real output and diagrams, and the 19-page Git & GitHub Cheat Sheet for quick revision before interviews and in daily use.

2
PDF ebooks
142
pages in total
21
guide chapters
18
cheat sheet sections
  • Secure checkout via Razorpay
  • Digital PDF ebook
  • Read on phone, tablet or laptop
PDF ebook
Two books, one purchase

The Complete Guide and the Cheat Sheet, side by side

The Complete Guide teaches Git and GitHub end to end. The Cheat Sheet puts the commands you use every day on 19 pages. You get both PDFs.

Book 1 · 123 pages

Git & GitHub: The Complete Guide

Beginner to advanced. Every command with real output and diagrams, from your first commit to GitHub Actions, security and open source.

  • 21 chapters + a command index appendix
  • Every command with real output and diagrams
  • Branching diagrams: fast-forward, three-way, rebase, cherry-pick, Git Flow, GitHub Flow, trunk-based
  • Error fixes and recovery recipes
  • 25 interview questions and a 30-day plan
  • Table of contents and page numbers
Book 2 · 19 pages

Git & GitHub Cheat Sheet

A quick reference for daily use and last-minute interview revision: “command | what it does” tables on every page.

  • 18 sections
  • “Command | what it does” tables on every page
  • Small diagrams for merge, rebase, reset and PR flow
  • Top 40 commands for last-minute revision
  • Cover and page numbers, no index
Git & GitHub: The Complete Guide compared with the Git & GitHub Cheat Sheet
FeatureComplete GuideCheat Sheet
Pages12319
LevelBeginner to advancedQuick reference
Structure21 chapters + command index appendix18 sections, “command | what it does” tables on every page
DiagramsFast-forward, three-way, rebase, cherry-pick, Git Flow, GitHub Flow, trunk-basedSmall diagrams for merge, rebase, reset and PR flow
Command outputEvery command with real output; most local Git outputs captured from a real Git sessionNot listed
NavigationTable of contents, page numbers, command indexCover and page numbers, no index
Interview prep25 interview questions and a 30-day planTop 40 commands for last-minute revision
Use it toLearn Git and GitHub end to endRevise before interviews and in daily use
Book 1 · 123 pages

Git & GitHub: The Complete Guide: all 21 chapters

Beginner to advanced, with a table of contents, page numbers and a command index. Open a group to see its chapters and topics.

Ch 01–06Git basics6 chapters · What version control is, setup, how Git stores your work, first commits, history and undo.
  1. 01
    Introduction to Version Control

    Git vs GitHub, history, vocabulary

  2. 02
    Installing & Configuring Git

    Windows/macOS/Linux, identity, SSH keys, tokens, gh login

  3. 03
    How Git Works Internally

    Three areas, objects, HEAD and refs, revision names

  4. 04
    Your First Repository

    init, clone, status, add, commit, .gitignore, rm, mv

  5. 05
    Exploring History

    log, show, diff, blame, grep, shortlog, describe

  6. 06
    Undoing Things Safely

    restore, reset soft/mixed/hard, revert, amend, clean, reflog

Ch 07–12Branches & collaboration6 chapters · Branching, merging, rebasing, stash and cherry-pick, team workflows and remotes.
  1. 07
    Branching in Detail

    branch, switch, detached HEAD, tracking, naming conventions

  2. 08
    Merging Branches

    Fast-forward, three-way, no-ff, squash, conflict resolution

  3. 09
    Rebasing

    rebase, interactive rebase, --onto, autosquash, merge vs rebase

  4. 10
    Stash, Cherry-pick, Tags & More

    bisect, worktree, submodules, hooks, patches

  5. 11
    Branching Strategies & Workflows

    Git Flow, GitHub Flow, trunk-based, release, forking

  6. 12
    Working with Remotes

    push, fetch, pull, rejected pushes, force-with-lease

Ch 13–19GitHub7 chapters · Repos and Issues, pull requests and review, the gh CLI, security, Actions, releases and open source.
  1. 13
    GitHub Fundamentals

    Repos, README, Issues, Projects, Discussions, roles

  2. 14
    Pull Requests & Code Review

    PR lifecycle, merge methods, CODEOWNERS, merge queue

  3. 15
    GitHub CLI (gh)

    Repos, issues, PRs, runs, releases, API

  4. 16
    Security & Branch Protection

    Signed commits, rulesets, Dependabot, secret scanning, CodeQL

  5. 17
    GitHub Actions: CI/CD

    Workflows, matrix, secrets, caching, reusable workflows, OIDC

  6. 18
    Releases, Pages, Packages, Codespaces & Copilot
  7. 19
    Open Source Workflow & Conventions

    Fork and sync, Conventional Commits, licences

Ch 20–21Advanced & reference2 chapters · LFS, partial clone, filter-repo, troubleshooting, interview Q&A and the command index.
  1. 20
    Advanced Git

    LFS, sparse/partial clone, filter-repo, range-diff, Git 3.0 prep

  2. 21
    Troubleshooting, Cheat Sheet & Interview Q&A

    Common errors, 25 interview questions, 30-day plan

  • Appendix: Command Index

    Every git and gh command with page numbers.

Inside the Complete Guide

Every command with real output, every branch drawn out

What you get beyond the chapter list.

  • Real output

    Most local Git outputs were captured from a real Git session, so you see what the terminal actually prints.

  • Branching diagrams

    Fast-forward, three-way merge, rebase, cherry-pick, Git Flow, GitHub Flow and trunk-based development, drawn out.

  • Easy to navigate

    Table of contents, page numbers and a command index listing every git and gh command with its page number.

  • Fix and recover

    Error fixes, recovery recipes and interview prep: 25 interview questions and a 30-day plan.

Branching diagrams in the Guide

  • Fast-forward merge
  • Three-way merge
  • Rebase
  • Cherry-pick
  • Git Flow
  • GitHub Flow
  • Trunk-based
Book 2 · 19 pages

Git & GitHub Cheat Sheet: 18 sections

A quick reference for daily use and last-minute interview revision: “command | what it does” tables on every page. Small diagrams for merge, rebase, reset and PR flow.

  1. 01
    The Mental Model

    Working dir, staging, repo, remote

  2. 02
    Setup & Config
  3. 03
    Start & Save Work

    init, add, commit, .gitignore, commit messages

  4. 04
    History

    log, show, blame

  5. 05
    Undo & Recover

    restore, reset, revert, reflog

  6. 06
    Branching
  7. 07
    Merging & Conflicts
  8. 08
    Rebase
  9. 09
    Stash, Cherry-pick, Tags & More
  10. 10
    Remotes & Syncing

    Fork workflow

  11. 11
    Branching Strategies

    Git Flow diagram

  12. 12
    GitHub: Pull Requests & Reviews
  13. 13
    GitHub CLI (gh)
  14. 14
    GitHub Actions (CI/CD)
  15. 15
    Security & Protection
  16. 16
    Fix-it Recipes & Common Errors
  17. 17
    Conventions & Pro Habits
  18. 18
    Top 40 Commands

    Last-minute revision

Topic finder

Where each Git and GitHub topic lives in both books

Chapter numbers refer to the Complete Guide, section numbers (§) to the Cheat Sheet.

Where each Git and GitHub topic is covered in the Complete Guide and the Cheat Sheet
TopicComplete GuideCheat Sheet
Git vs GitHub, the mental modelCh 01, Ch 03 (three areas, objects, HEAD and refs)§01 The Mental Model
Install, config, SSH keys, tokensCh 02§02 Setup & Config
init, add, commit, .gitignoreCh 04§03 Start & Save Work
log, show, diff, blameCh 05§04 History
restore, reset, revert, reflogCh 06§05 Undo & Recover
Branches and detached HEADCh 07§06 Branching
Merging and conflictsCh 08 fast-forward, three-way, no-ff, squash§07 Merging & Conflicts
Rebase and interactive rebaseCh 09 incl. --onto, autosquash§08 Rebase
Stash, cherry-pick, tags, bisectCh 10 incl. worktree, submodules, hooks, patches§09
Git Flow, GitHub Flow, trunk-basedCh 11§11 Branching Strategies
push, fetch, pull, force-with-leaseCh 12§10 Remotes & Syncing
Pull requests and code reviewCh 14 incl. CODEOWNERS, merge queue§12
GitHub CLI (gh)Ch 15§13
GitHub Actions CI/CDCh 17 incl. matrix, caching, reusable workflows, OIDC§14
Security and branch protectionCh 16 incl. signed commits, rulesets, Dependabot, CodeQL§15
Open source and Conventional CommitsCh 19§17 Conventions & Pro Habits, §10 fork workflow
Advanced Git (LFS, partial clone)Ch 20Not covered
Common errors and fixesCh 21§16 Fix-it Recipes & Common Errors
Interview preparationCh 21: 25 questions, 30-day plan§18 Top 40 Commands
Command lookupAppendix: Command IndexCommand tables on every page
Quick answers

Common Git questions, answered in short

The questions developers search for most, with where the Complete Guide goes deeper.

  • What is the difference between Git and GitHub?

    Git is a distributed version control system that runs on your computer and records the history of your files. GitHub is an online platform that hosts Git repositories and adds collaboration features such as pull requests, code review, Issues and GitHub Actions. You can use Git without GitHub, but GitHub is built on Git. Covered in Chapter 1.

  • What is the difference between git merge and git rebase?

    git merge joins two branches and keeps their history as it happened, creating a merge commit unless a fast-forward is possible. git rebase replays your commits on top of another branch, giving a straight, linear history but creating new commit IDs. Avoid rebasing commits that others have already pulled. Covered in Chapters 8 and 9.

  • What is the difference between git reset and git revert?

    git reset moves your branch back to an earlier commit and rewrites history (--soft keeps changes staged, --mixed keeps them unstaged, --hard discards them), so use it on local work. git revert adds a new commit that undoes an earlier one without rewriting history, so it is safe on shared branches. Covered in Chapter 6.

  • How do I recover a commit I lost after a reset?

    Run git reflog to see every position HEAD has recently been at, find the commit hash from before the reset, then run git reset --hard <hash> or create a branch at it with git branch <name> <hash>. Covered in Chapter 6.

  • What does git push --force-with-lease do?

    It force-pushes your branch only if the remote branch is still where you last saw it. If someone else pushed in the meantime, the push is refused instead of overwriting their work, which makes it safer than --force. Covered in Chapter 12.

  • What is the difference between git fetch and git pull?

    git fetch downloads new commits from the remote and updates remote-tracking branches without touching your work. git pull runs a fetch and then merges (or rebases) those changes into your current branch. Covered in Chapter 12.

  • What is a detached HEAD in Git?

    HEAD normally points to a branch. In a detached HEAD state it points straight at a commit, for example after checking out a tag or a commit hash. New commits made there belong to no branch, so create one with git switch -c <name> if you want to keep them. Covered in Chapters 3 and 7.

Questions

Before you buy

Anything else? Write to [email protected]

What do I get when I buy the Git & GitHub ebook?

Both books in one purchase, as PDF ebooks. Git & GitHub: The Complete Guide (123 pages, 21 chapters plus a command index) takes you from beginner to advanced with every command shown with real output and diagrams. The Git & GitHub Cheat Sheet (19 pages, 18 sections) is a quick reference with “command | what it does” tables on every page.

What is the difference between the Complete Guide and the Cheat Sheet?

You get both. Use the Complete Guide to learn Git and GitHub in depth: internals, branching, merging, rebasing, remotes, pull requests, the gh CLI, security, GitHub Actions and advanced Git. Use the Cheat Sheet for quick revision before interviews and in daily use: 19 pages of command tables with small diagrams for merge, rebase, reset and PR flow.

Is the Git book suitable for beginners?

Yes. It goes from beginner to advanced: it starts with what version control is, how to install and configure Git, and your first repository, then moves on to branching, rebasing, GitHub, CI/CD with GitHub Actions and advanced topics like LFS, sparse and partial clone, filter-repo and range-diff.

Is the command output in the Git book real?

Every command is shown with its output. Most local Git outputs were captured from a real Git session.

Does the book cover GitHub, pull requests and GitHub Actions?

Yes. Chapters 13 to 19 cover GitHub: repos, README, Issues, Projects and Discussions; pull requests and code review (PR lifecycle, merge methods, CODEOWNERS, merge queue); the GitHub CLI (gh); security and branch protection (signed commits, rulesets, Dependabot, secret scanning, CodeQL); GitHub Actions CI/CD (workflows, matrix, secrets, caching, reusable workflows, OIDC); releases, Pages, Packages, Codespaces and Copilot; and the open source workflow.

Does it cover branching strategies like Git Flow and trunk-based development?

Yes. Chapter 11 covers Git Flow, GitHub Flow, trunk-based development, release branches and forking workflows, with diagrams. The Cheat Sheet has a Branching Strategies section with a Git Flow diagram.

Do the Git ebooks help with interview preparation?

Yes. The last chapter of the Complete Guide covers common errors, 25 interview questions and a 30-day plan. The Cheat Sheet ends with the top 40 commands for last-minute revision.

What format are the Git ebooks in?

Both are PDF ebooks by Target Trek (targettrek.in), readable on phone, tablet or laptop.

Every Git command, every GitHub workflow, with real output.

Both PDFs: Git & GitHub: The Complete Guide (123 pages) and the Git & GitHub Cheat Sheet (19 pages).

Resume Lab by Target Trek

Applying everywhere but getting no interview calls?

Your book gets you ready for the interview. A better resume gets you the call. See exactly which lines cost you shortlists, and how to fix each one.

~2 min
AI report
Real people
review it
Pay once
no subscription
Git & GitHub Complete Guide + Cheat Sheet
…