⊗gtPmBsFT 11 of 65 menu

Tracking Files in Git

In the previous lesson, we initialized Git in our project. Now we can use Git commands to save the project, or, in the correct terminology, make commits.

However, it's not that simple. The thing is that each project has files that don't need backups. For example, cache files. That's why in the Git system we need to explicitly specify which files we want to save.

In Git, there are two types of files: untracked and tracked.

Tracked files are files that Git watches for changes. When these files change, Git will notify us.

Untracked files are files that Git does not track changes to. Initially, all files will be like this. But to make Git track files, you need to specifically ask it to do so. Let's figure out how to do this.

First, we need to learn how to view file states. For this, Git has a special command status:

git status

Let's say you have several files in your project folder:

  • index.html
  • styles.css

These files are initially untracked. In this case, the status command will list these files as follows:

Untracked files: index.html styles.css

Check the status of files in your project.

Make another file in the project folder. Check the status. Make sure the new file appears in the untracked list.

English
БеларускаяDeutschEspañolFrançaisPortuguêsРусский
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline