Skip to content

Git areas

  • There are 3 areas

  • Working directory: The files the appear in the folder to the user

  • ls
  • Staging area (index): Prepare file to be inserted/extracted to/from git repo
  • git ls-files
  • Git repository: Where the git objects live
  • find .git/objects -type f

File tracking statuses

File Statuses

  1. Untracked
  2. New files added to working dir
  3. Modified
  4. Committed file, but there is a newer version
  5. Deleted
  6. Committed file, but it has been removed from working directory
  7. Staged
  8. When a file (untracked or modified) is added to staging area
  9. Unmodified
  10. Committed file, and there is no newer version. These files are not shown in git status

  11. A tracked file (modified, staged or unmodified) can also be untracked again

Git files lifecycle