Git & GitHub¶
Beginner → Intermediate · 6 topics
Every GenAI codebase, from a Streamlit demo to a production RAG platform, lives in Git, and every job expects you to be comfortable with it: branching, reviewing pull requests, fixing a bad merge, rolling back a broken deploy. This series goes beyond the daily commands to how Git actually works, so the confusing moments make sense, and ends with the problems that are specific to AI projects: leaked API keys, huge model files, notebooks and prompt versioning.
git --version # these pages were run with Git 2.50; anything from 2.30 up works
gh --version # GitHub CLI, for page 4 onwards: https://cli.github.com
| # | Topic | Sub-topics |
|---|---|---|
| 1 | How Git works | Setup · working tree, staging area, repository · diff and log · commits, trees and blobs · hashes in Python · .gitignore |
| 2 | Branches and merging | Branches as pointers · fast-forward and three-way merges · resolving conflicts · rebase · merge vs rebase · cherry-pick |
| 3 | Undoing changes | restore · amend · reset soft, mixed, hard · reflog recovery · revert · stash · clean · what's safe after a push |
| 4 | Working with GitHub | Authentication · remotes and push -u · clone · fetch vs pull · rejected pushes · forks · pull requests with gh |
| 5 | Team workflows | GitHub flow · branch names · Conventional Commits · code review · merge strategies · branch protection · tags and releases · bisect · blame |
| 6 | Git for GenAI projects | .gitignore for AI apps · leaked API keys · secret scanning · LFS, DVC and the Hub · notebooks · pre-commit · prompts and evals in CI |
flowchart LR
W[Working tree] -- add --> S[Staging area] -- commit --> L[Local repo]
L -- push --> R[GitHub]
R -- fetch / pull --> L
R --> PR[Pull request<br/>review + CI] --> M[main] --> D[Deploy]
Just need the daily commands?
The Use Git every day tutorial is the short version: set up, the daily loop, branches, sync and a cheat sheet. This series is the deep dive behind it.
All terminal output on these pages comes from real runs. Commit hashes depend on your name, email and the time, so yours will be different.
Back to: Notes overview