File/dir/submodule dirtiness status

The dirtiness/status describes how the state of a file in a work tree differs from the base state in the repo. That is used by status, post and other commands. post's mission is to bring the git tree into the same state as the work tree. For get, it is the other way around. The decision tree for file dirtiness status is listed here.

  1. present in base tree
    1. present in work tree
      1. ok no changes

2. mod user changes 3. put staged user changes 4. pat patched (theirs) 5. mrg merged (both) 6. cnf merge conflict 7. adv advanced submodule (committed changes, not staged yet)

  1. absent in work tree
    1. mis missing

2. del staged delete 3. rmv moved (away)

  1. absent in base tree
    1. present in work tree
      1. new staged

2. unk unknown 3. mov moved (here)

  1. - absent in work tree

Nesting

For directories and submodules (gitlinks) most statuses work the same. Directory is implied dirty if any of its contents are dirty; same applies to submodules. That is implied, not shown. Staging any file in a dir stages the dir (as a git tree object). Any staged change in a submodule stages a submodule, more or less the same way.

Branch divergence status

(Related) status shows the state of the worktree relative to any branch (default: the tracked branch). That is a list of divergent commits of two categories:

  1. post present here, not there
  2. miss present there, not here