When the status
command is executed, Git checks for the file's path and size. If there are no differences, it leaves it as it is, but if any differences are found, it goes ahead and computes the hash with which it checks for a relation to other hashes, as we saw earlier.
The file path comparison as such happens in the following stages:
Stage number |
Comparison |
Related status message |
---|---|---|
1 |
File path present in index versus recent commit (HEAD commit) |
Changes to be committed |
2 |
File path present in index versus working tree |
Changes not staged for commit |
3 |
Paths in the working tree that are not tracked by Git (and are not ignored by |
Changes not staged for commit |
The first status denotes changes that have already been added (staged) but not committed. So executing git commit
would complete the versioning process.
The second and third statuses denote that the changes are not yet added (staged) for a commit. So to complete the versioning process,...