We have to take a few minutes to look at the life cycle of a file inside Git.
A file will go through the following states, and the Git command line will take the file from one state to another. We will explain each state and its command line.
The important part of this schema is the triangle between the three states UNMODIFIED, MODIFIED, and STAGED. This triangle is an infinite loop. Indeed, every time you change a file, its state is set to modified, and then staged; when you commit the file, it returns to the unmodified state, and so on.
UNTRACKED is the first state where the file is created, but this isn't tracked by ...