Git Course
Master professional version control, Git workflows, collaboration systems, GitHub engineering & production development practices.
Architecture
Git Commit Lifecycle
From a developer's edit to remote collaboration — through working directory, staging area, local repo and remote.
Enterprise learning path
Git Fundamentals
- 1Git HomeNext up
Welcome to the complete Git course — your roadmap from absolute beginner to a confident, production-grade version control engineer who ships safely every day.
- 2Introduction to Version Control
Version control is a system that records every change to your files so you can travel back in time, compare versions, and collaborate with teammates without overwriting each other.
- 3What is Git?
Git is a fast, distributed version control system created by Linus Torvalds in 2005 to manage the Linux kernel — every developer keeps a full copy of the project history on thei…
- 4Why Developers Use Git
Git is used by 95% of professional developers because it lets teams branch fearlessly, review changes line-by-line, automate testing on every push, and roll back instantly when…
- 5Installing Git
Installing Git takes under two minutes on macOS, Windows or Linux and gives you the same command-line tool used inside GitHub, GitLab, Bitbucket and Azure DevOps.
- 6Git Configuration
Git configuration sets your identity, default branch name, editor, alias shortcuts and merge tool — values stored in ~/.gitconfig that follow you across every repository.
- 7Initializing Repositories
Running git init creates a hidden .git folder that turns any directory into a fully tracked Git repository ready for its first commit.
- 8Working Directory Explained
The working directory is the regular folder on disk where you actually edit files — Git watches it and reports which files have changed since the last commit.
- 9Git Staging Area
The staging area (also called the index) is a draft of your next commit — a place to carefully assemble exactly which changes belong together before you snapshot them.
- 10Creating Commits
A commit is an immutable snapshot of your staged changes plus a message, an author, a timestamp and a parent — together they form the chain that is your project history.
- 11Git Status
git status is the most-typed Git command in the world — it answers: which files changed, which are staged, and what branch am I on?
- 12Git Log
git log walks the commit chain backwards from HEAD, showing who shipped what and when — essential for code archaeology and incident investigation.
- 13Undoing Changes
Undo in Git is layered: restore undoes file edits, reset moves the branch pointer, and revert safely creates an inverse commit on shared history.
- 14Git Ignore
.gitignore tells Git which files (build outputs, secrets, node_modules, .env) to never track — protecting both your repository size and your security.
- 15Git Best Practices
Best practices like Conventional Commits, short-lived branches, atomic commits and signed commits separate hobby repositories from production-grade engineering.
Git Branching
- 16Introduction to Branching
A branch in Git is just a tiny pointer to a commit — creating one is instantaneous and lets you explore an idea without disturbing main.
- 17Creating Branches
git branch feature/login and git switch -c feature/login create a new branch — the second also moves you onto it in one step.
- 18Switching Branches
git switch replaces the older git checkout for moving between branches — Git updates your working directory to match that branch's snapshot.
- 19Branch Workflow
A clean branch workflow is: pull main, branch off, commit small chunks, push, open a PR, react to review, merge — repeat several times a day.
- 20Feature Branching
Feature branching means every change — even a one-line typo fix — gets its own short-lived branch so it can be reviewed and tested in isolation.
- 21Merge Basics
git merge combines two branch histories into one — Git either fast-forwards the pointer or creates a merge commit with two parents.
- 22Fast Forward Merge
A fast-forward merge happens when main hasn't moved since you branched — Git just slides the pointer forward, leaving a perfectly linear history.
- 23Merge Conflicts
A merge conflict happens when two branches change the same lines — Git inserts markers and asks you to choose.
- 24Conflict Resolution
Resolving conflicts means reading both sides, picking what should survive, deleting the markers, then git add the file and committing to complete the merge.
- 25Git Rebase Basics
git rebase replays your commits on top of another branch's tip — producing a clean, linear history at the cost of rewriting commit SHAs.
- 26Cherry Picking
git cherry-pick copies a single commit from one branch onto another — perfect for back-porting a bug fix from main to a release branch.
- 27Stashing Changes
git stash shelves your work-in-progress so you can switch branches with a clean tree, then pop it back later.
- 28Branch Cleanup
Deleting merged branches with git branch -d and pruning stale remotes with git fetch --prune keeps your team's branch list readable.
- 29Branch Naming Conventions
Naming branches feature/*, fix/*, hotfix/*, release/* tells humans and CI bots exactly how to treat the branch.
- 30Enterprise Branch Strategies
Strategies like Git Flow, GitHub Flow and Trunk-Based Development each trade off release cadence vs branch complexity — pick one and document it.
Git Collaboration
- 31Team Collaboration Basics
Collaboration with Git means everyone holds a full copy of history and synchronises through a shared remote — usually GitHub or GitLab.
- 32Git Pull
git pull is shorthand for git fetch + git merge (or --rebase) — it brings your branch up to date with the remote.
- 33Git Push
git push uploads your local commits to the remote and updates the remote branch pointer — the moment your teammates can see your work.
- 34Git Fetch
git fetch downloads new commits from the remote without touching your working directory — letting you inspect changes before merging.
- 35Pull Requests
A pull request is a hosted conversation around a topic branch: discussion, line-by-line review, automated CI checks and a final merge button.
- 36Code Reviews
Code review is where engineering culture lives — it catches bugs, spreads knowledge, and gives juniors a structured place to learn from seniors.
- 37Forking Repositories
A fork is your own server-side copy of someone else's repository — the standard pattern for contributing to open source projects you don't have write access to.
- 38Open Source Workflow
The open source workflow is fork → branch → commit → push → pull request — millions of contributions to React, Vue, Linux and Kubernetes follow this exact path.
- 39Team Development Workflow
A healthy team workflow combines short branches, fast PRs, green CI, automated deploys and observable production — Git sits at the heart of all of it.
- 40Git Collaboration Strategies
Squash, rebase, merge commits, protected branches, required reviewers and signed commits all combine into a strategy your team agrees on once and lives with daily.
- 41Pair Programming Workflow
Pair programming with Git uses the Co-authored-by: trailer in the commit message so both engineers receive credit for the work.
- 42Git Permissions
GitHub and GitLab let you grant Read, Triage, Write, Maintain or Admin permissions per team — least privilege keeps production safe.
- 43Collaboration Best Practices
Best practices: protect main, require PR reviews, enforce status checks, ban force-push, sign commits, and keep PRs small.
- 44Handling Large Teams
Large teams use code owners files, monorepos, ring-based deploys and merge queues to keep hundreds of engineers shipping to the same trunk safely.
- 45Enterprise Git Collaboration
Enterprises layer SSO, SAML, audit logs, secret scanning, branch protection and compliance gates on top of Git — making collaboration both fast and safe.
GitHub & Remote Repositories
- 46Introduction to GitHub
GitHub is the world's largest Git hosting platform — 100M+ developers use it for code, code review, issues, projects, CI/CD and package hosting.
- 47Creating GitHub Repositories
Creating a repository on GitHub takes 30 seconds and gives you a remote URL plus a default main branch ready for your first push.
- 48Connecting Local & Remote Repositories
git remote add origin wires your local repo to a remote URL — from then on git push and git pull sync the two.
- 49SSH Keys
SSH keys let you push to GitHub without typing a password — generate with ssh-keygen -t ed25519 and paste the public key into your GitHub settings.
- 50HTTPS Authentication
Over HTTPS, GitHub now requires a personal access token (PAT) or the GitHub CLI helper instead of your account password.
- 51GitHub Issues
Issues are the lightweight tickets where bugs, features and discussions live — every commit can reference an issue with #123 for full traceability.
- 52GitHub Projects
GitHub Projects is a flexible kanban / table view that turns issues and PRs into a planning board — agile boards without leaving the repo.
- 53GitHub Actions Basics
GitHub Actions runs YAML workflows on every push or PR — perfect for tests, linters, security scans, builds and deploys.
- 54GitHub Discussions
Discussions are forum-style conversations attached to a repository — the right home for Q&A, RFCs and community announcements.
- 55GitHub Releases
Releases are tagged snapshots of your code with notes and downloadable assets — the way semver versions like v1.4.0 reach your users.
- 56Repository Management
Repository management covers settings, secrets, environments, branch protection, code owners and webhooks — the levers that turn a repo into a product.
- 57Open Source Contributions
Contributing to open source teaches you to read large codebases, follow community style guides, and engage respectfully with maintainers in PR reviews.
- 58GitHub Security
GitHub Advanced Security adds secret scanning, Dependabot, CodeQL static analysis and signed commits — all driven by Git history.
- 59Repository Optimization
Optimization means small clones, shallow fetches, Git LFS for binaries, archived old branches and a clear CODEOWNERS file.
- 60Real GitHub Workflows
Real workflows combine PRs, Actions, Environments, required reviewers and merge queues — exactly how Vercel, Stripe and Shopify ship to production.
Advanced Git Workflows
- 61Git Flow Workflow
Git Flow uses long-lived develop, release/* and hotfix/* branches around main — great for products with scheduled releases.
- 62Trunk-Based Development
Trunk-based development means short branches and many merges per day to a single main trunk — the model used by Google, Facebook and most SaaS companies.
- 63Monorepo Strategies
A monorepo holds many projects in one Git repo — tools like Nx, Turborepo and Bazel make builds, tests and deploys scale across thousands of packages.
- 64Semantic Versioning
Semantic Versioning (MAJOR.MINOR.PATCH) communicates breaking, additive and bug-fix changes — automated by tools like semantic-release driven from commit messages.
- 65Release Management
Release management turns a sequence of merged PRs into a versioned, tagged, documented release — usually automated end-to-end.
- 66CI/CD Integration
Continuous Integration runs tests on every push; Continuous Deployment ships every green commit to production — Git is the trigger and the audit log.
- 67Automated Deployments
Automated deploys push your code from a green CI run to staging or production with zero human steps — and roll back automatically if health checks fail.
- 68Git Hooks
Git hooks are scripts in .git/hooks that run at lifecycle events — pre-commit, commit-msg and pre-push enforce style and tests locally.
- 69Interactive Rebase
git rebase -i lets you reorder, squash, edit or drop commits on a branch — the power tool for cleaning up history before a PR lands.
- 70Squashing Commits
Squashing collapses many WIP commits into one tidy commit — most teams squash on merge so main reads like a clean changelog.
- 71Bisect Debugging
git bisect performs a binary search over your commit history to find the exact commit that introduced a bug — minutes instead of hours.
- 72Git Submodules
Submodules embed one Git repo inside another at a pinned SHA — useful for shared libraries, but heavier than monorepos or package managers.
- 73Git Tags
Tags are immutable named pointers to specific commits — annotated tags also carry a message and a signature, ideal for releases.
- 74Deployment Workflows
Deployment workflows like blue/green, canary and rolling all use Git tags or branches as the source of truth for what is live where.
- 75Enterprise Git Architecture
Enterprise architectures combine self-hosted GitHub Enterprise, mirror caches, runners and policy engines to serve thousands of developers globally.
Git Internals & Optimization
- 76How Git Works Internally
Internally Git is a content-addressed snapshot store — every file, directory and commit is keyed by the SHA of its content.
- 77Git Objects
Git has four object types: blob (file), tree (directory), commit (snapshot) and tag — together they form the entire history.
- 78Blobs, Trees & Commits
A commit points to one tree (the root directory snapshot); each tree points to blobs (files) and sub-trees — a recursive snapshot at every commit.
- 79SHA Hashing
Git uses SHA-1 (migrating to SHA-256) to address every object — change one byte and the SHA changes, which is why history is tamper-evident.
- 80Git Storage Architecture
Git stores loose objects in .git/objects/xx/yyyy...
- 81Pack Files
Pack files are zlib-compressed bundles of related objects with delta compression — they shrink a 100MB checkout into a few MB on disk.
- 82Performance Optimization
Performance tricks include partial clones, sparse checkouts, commit-graph files and the file system monitor — essential at monorepo scale.
- 83Large Repository Management
Large repos benefit from Git LFS for binaries, scalar enlistments, sparse-checkout and shallow clones — Microsoft uses these on a 300GB Windows monorepo.
- 84Git Garbage Collection
git gc repacks loose objects, prunes unreachable ones older than two weeks, and rewrites the reflog — keeping repositories fast over years of use.
- 85Debugging Git Problems
Debug Git issues with GIT_TRACE=1, git fsck, git reflog and git cat-file — the same tools support engineers use.
- 86Recovering Lost Commits
Use git reflog to find any commit you've ever had checked out, then git switch -c rescue to bring it back as a branch.
- 87Git Security Practices
Sign commits with GPG or sigstore, scan for secrets pre-commit, ban force-push to main, and require 2FA on every contributor account.
- 88Backup Strategies
Mirror clones (git clone --mirror) plus offsite encrypted snapshots give you bulletproof Git backups even if GitHub goes down.
- 89Repository Scaling
Scaling a repo means commit-graph caches, parallel fetch, pack file partitioning and a CDN-fronted Git server — all transparent to the developer.
- 90Production Git Systems
Production Git systems run behind load balancers, with mirror caches per region, audit logs streamed to SIEM, and health checks driving auto-failover.
Real-World Git Engineering
- 91Git in Enterprise Teams
Enterprise teams pair Git with SSO, audit logs, signed commits and CODEOWNERS so hundreds of engineers can ship safely against the same trunk.
- 92SaaS Development Workflow
Modern SaaS teams branch off main, ship dozens of PRs per day, deploy automatically on merge, and roll back via Git revert if metrics drop.
- 93Frontend Team Collaboration
Frontend teams pair Git with Storybook, Chromatic visual reviews and preview deploys per PR — every change visible before merge.
- 94Backend Team Workflow
Backend teams add database migration files, contract tests and feature flags to every Git branch so risky changes can be released dark first.
- 95Full Stack Development Workflow
Full-stack workflows synchronise frontend and backend changes inside a single PR using monorepos and atomic version bumps.
- 96Agile Development with Git
Agile sprints map naturally to Git: each user story becomes a branch, each PR a deliverable, each tag a release — all visible on the project board.
- 97DevOps & Git Integration
DevOps treats Git as the single source of truth — Infrastructure-as-Code, GitOps and ArgoCD all reconcile production from Git commits.
- 98Release Engineering
Release engineers own the train: tagging versions, generating changelogs from commits, and orchestrating staged rollouts driven by Git tags.
- 99Hotfix Workflow
A hotfix branches from the production tag, applies the smallest possible fix, ships through expedited CI and is then merged back into main.
- 100Incident Recovery Workflow
During an incident, git revert on the bad merge plus a re-deploy is the fastest, safest rollback — no manual file edits needed.
- 101Multi-Team Collaboration
Multi-team collaboration uses CODEOWNERS, ring-based deploys, internal forks and merge queues to keep dozens of teams unblocked.
- 102Startup Engineering Workflow
Startups stay lean with trunk-based development, GitHub Actions, Vercel previews and one-click rollbacks — Git is the entire ops department.
- 103Open Source Engineering
Open source engineers maintain healthy projects with issue templates, contribution guides, signed commits, semantic-release and welcoming reviews.
- 104Production Release Pipeline
A production release pipeline turns every green merge to main into a versioned tag, container image, deploy and changelog — fully driven by Git.
- 105Enterprise Collaboration Systems
Enterprise systems integrate Git with Jira, ServiceNow, Slack and SSO so every commit, PR and deploy is auditable end-to-end.
Practice & Interview Preparation
- 106Git Exercises
Hands-on exercises: initialise a repo, stage selectively, write a Conventional Commit message, push, open a PR and merge it — repeat until automatic.
- 107Branching Challenges
Branching challenges: rebase a feature onto a moving main, cherry-pick a fix into a release, and split one big commit into three using interactive rebase.
- 108Merge Conflict Challenges
Merge conflict drills: resolve overlapping line edits, deletes vs renames, and three-way conflicts using git mergetool.
- 109Collaboration Challenges
Collaboration drills: review a PR with constructive feedback, request changes, approve, and use the merge queue safely.
- 110GitHub Challenges
GitHub-specific drills: write an Actions workflow, protect main, configure required checks, and publish a release with auto-generated notes.
- 111Git Interview Questions
Common Git interview questions span working tree vs index vs HEAD, fast-forward vs three-way merge, rebase vs merge, and recovery from force-push.
- 112Mock Git Interviews
A mock Git interview asks you to walk through a real scenario at the whiteboard: a teammate force-pushed, CI failed, the prod tag is missing — what now?
- 113Real-World Git Scenarios
Real scenarios: rolling back a bad deploy, splitting a monolith, cherry-picking a security patch into three release branches at once.
- 114Git Workflow Challenges
Workflow challenges compare Git Flow, GitHub Flow and Trunk-Based Development — pick the right one for a given team size and release cadence.
- 115Debugging Challenges
Debugging drills: use git bisect to find a regression, git blame to find an author, and git fsck to recover a corrupted repo.
- 116Open Source Contribution Tasks
OSS tasks: fork a project, add a test, run the linter, sign your commits with DCO, open a PR and respond to review feedback.
- 117Repository Recovery Challenges
Recovery drills: rescue a deleted branch from reflog, undo a force-push from a teammate's local clone, and restore a lost commit.
- 118CI/CD Git Tasks
CI/CD drills: write a workflow that runs on PRs, gate merges on green checks, build and push a Docker image on tag, and deploy to a preview environment.
- 119Team Collaboration Simulations
Simulations put you on a 5-engineer team for one sprint — open PRs, review each other's code, resolve conflicts and ship a clean release tag.
- 120Enterprise Git Assessments
Enterprise assessments measure your fluency with monorepos, CODEOWNERS, signed commits, audit trails and incident recovery — the senior bar.