Git & GitHub Documentation
A structured course for mastering Git version control and GitHub collaboration — from first-time setup to production CI/CD pipelines and advanced history management.
Learning Path
1. Introduction
Start here to understand what Git is, how it works internally, and how it compares to alternatives.
- What is Git? — Snapshots, three-tree architecture, distributed model
- Git vs Other VCS — How Git compares to SVN, Mercurial, Perforce
- How Git Works Internally — SHA objects, DAG, branches as pointers
- Installation & Setup — Install, configure identity, first repo
2. Configuration
Set up SSH keys, personal access tokens, and optimize your Git environment.
- Git Configuration — Global/local config, aliases, optimization
- SSH Key Setup — Generate keys, configure SSH, test connection
- GitHub Personal Access Token — API tokens, secure storage
3. Core Commands
Master the commands you'll use every day.
- init, clone & status — Create repos, clone, check state
- add, commit & diff — Stage, commit, inspect changes
- log & History — Navigate history, blame, reflog
- stash & clean — Save work temporarily, clean up
4. Branching & Merging
Work in parallel and combine changes safely.
- Branching Fundamentals — Create, switch, list, delete branches
- Merge Strategies — Fast-forward, three-way, squash merges
- Rebase Explained — Linear history, interactive rebase intro
- Conflict Resolution — Read markers, resolve systematically
5. Remote Operations
Connect to GitHub and collaborate with others.
- Remotes, Push, Pull & Fetch — Sync with remote repositories
- Repository Creation — Create repos via web, API, and CLI
- Forking & Pull Requests — Contribute to projects, code review
6. Commits & Tags
Master commit anatomy and version management.
- Commits & Tags — Commit best practices, semantic versioning
7. Workflows
Choose and implement the right branching strategy for your team.
- Daily Workflow — Day-to-day Git operations and sequences
- Gitflow Workflow — Feature, release, and hotfix branches
- Trunk-Based Development — CI/CD-friendly single-branch workflow
- Monorepo Patterns — Multiple projects in one repository
8. GitHub Features
Leverage GitHub's platform beyond basic hosting.
- Issues & Projects — Bug tracking and project management
- Actions & CI/CD — Automated testing and deployment
- Pages & Releases — Host sites, publish versions
- Security Features — Dependabot, secret scanning, branch protection
9. Advanced
Power-user techniques for history management and automation.
- Interactive Rebase — Squash, reword, split, and reorder commits
- Cherry-Pick & Bisect — Select commits, find bug introductions
- Submodules & Subtrees — Include external repositories
- Hooks & Automation — Pre-commit, pre-push, and CI hooks
10. Troubleshooting
Diagnose and fix problems when things go wrong.
- Common Errors — Error messages and quick fixes
- Undoing Changes — Restore, reset, revert at every level
- Recovery Techniques — Recover branches, commits, and repos
11. Cheat Sheets
Quick-reference cards for every Git scenario.
- Basic Commands — Init, add, commit, log, diff, undo
- Branching & Merging — Branch, merge, rebase, conflicts
- Remote Operations — Push, pull, fetch, tags, forks
- Advanced Commands — Cherry-pick, bisect, submodules, hooks
12. AI Collaboration
- Working with AI — Use AI assistants for Git & GitHub automation
Quick Start
# 1. Configure Git
git config --global user.name "donnyaw"
git config --global user.email "donnyaw@gmail.com"
git config --global init.defaultBranch main
# 2. Create a repository
mkdir my-project && cd my-project
git init
# 3. Make your first commit
echo "# My Project" > README.md
git add README.md
git commit -m "Initial commit"
# 4. Push to GitHub
git remote add origin git@github.com:donnyaw/my-project.git
git push -u origin main
Current Configuration
| Setting | Value |
|---|---|
| Username | donnyaw |
| donnyaw@gmail.com | |
| SSH Key | ~/.ssh/github/id_ed25519 (ED25519) |
| Token | ~/.config/github/token (600 permissions) |
| Default Branch | main |
New to Git? Follow sections 1 → 5 in order for a complete foundation. Then explore sections 7–9 based on your needs.