Vasu Patel logoVasu Patel
← Git Mastery
All chapters in this track
  1. 011. The Mental Model
  2. 022. Essential Setup
  3. 033. Core Daily Workflow
  4. 044. Branching
  5. 055. Merging & Conflict Resolution
  6. 066. Rebasing
  7. 077. Remote Repositories
  8. 088. Stashing
  9. 099. Undoing Things
  10. 1010. Tagging & Versioning
  11. 1111. Cherry-Pick
  12. 1212. Git Bisect & Blame
  13. 1313. Git Hooks
  14. 1414. Submodules
  15. 1515. Team Workflows
  16. 1616. Power Commands & Aliases
  17. 1717. Reflog: The Safety Net
  18. 1818. Practice Tasks
  19. 19Quick Reference Cheatsheet

Chapter 1 of 19

1. The Mental Model

Git has three local areas and one remote:

Working Directory  →  Staging Area (Index)  →  Local Repo  →  Remote Repo
   (your files)         (git add)              (git commit)    (git push)
AreaWhat lives here
Working DirectoryFiles you're actively editing
Staging AreaSnapshot of changes you've selected for the next commit
Local RepositoryFull project history (.git/ folder)
Remote RepositoryShared copy on GitHub/GitLab/Bitbucket

Key insight: git add does NOT commit. It stages. You choose exactly what goes into each commit.

Every commit is a snapshot, not a diff. Git stores complete file states, then uses delta compression internally.