Introduction to Versioning Commits
We have already discussed version control, and we have established that it aids in tracking changes. In this topic, we will address the following question:
How can we make Git track and monitor the changes in a file?
Our aim is to examine and demonstrate the various stages that a file passes through to become a candidate for a commit.
In Git, files can have the following statuses:
- Untracked: This a file that exists in the working tree whose changes are not being monitored by Git and aren't listed in the
gitignore
file. - Unstaged: This a file whose changes are being tracked by Git; the file has been changed since the last commit and has yet to be moved to the index.
- Staged: This is a file whose changes are being tracked by Git; the file has been changed since the last commit and has been moved to the index. This file is a file that is ready for the Git commit. Staged files are the files in the index that are different...