They are documented (although not everything is obvious, I think) in the gitrevisions documentation :
A colon, optionally followed by a stage number (0 to 3) and a colon followed by a path, names the blob in the index on that path. An invalid stage number (and the colon that follows) indicates the entry for stage 0. During the merge, stage 1 is a common ancestor, the second stage is a version of the target branches (usually the current branch), and stage 3 is the version from the branch, which unites.
To do this, you need to add knowledge about how git rebase and git cherry-pick .
The usual cherry pick is clearly defined: "ours" is the HEAD version, i.e. the branch you were on (and still have), and "them" is a commit that you are actively collecting. When you choose a single commit in a cherry-like fashion, all of this is pretty obvious: stage number 1 is a common ancestor, stage number 2 is the version from the tip of your current branch, and stage number 3 is the version you chose for cherry.
If you cherry-pick a series of commits, this is still true, it is just iteratively true. Say you, for example, have chosen three vitamins. Git is just three times in a row. During the first set of cherries, step number 2 is the end of your branch, and step number 3 is the version with the first commit selected in cherry color. After this completes the cherry grip, Git commits again, pushing the tip of your branch. Then, during the second set of cherries, stage number 2 is the tip of your branch, which is the fixation of your first cherry pick, and stage number 3 is an option from the second commit taken. This is repeated again for final fixation. Each time stage number 3 is "their" version.
Rebase, however, is a bit more complicated. Inside, it starts with the fact that you get to a new anonymous branch ("separate head"). Then it runs git cherry-pick to select each commit from your source branch. This means that "ours" is a separate version of HEAD, and "theirs" is a version from your original branch. Like cherries, it repeats iteratively for each commit you want to select (literally in the case of interactive permutation, where you edit pick lines). Once the overflow is over, Git simply moves the branch label around, so the new anonymous branch you just created is your code.
In short, you may think of rebase as a “rearrange of our / their settings”, but this is an exaggeration. Perhaps it would be more accurate to say that the second stage is your new, combined code, and stage 3 is your old code.