What are Untracked Files in Git?


Whenever Git finds a new file inside the application folder, it is considered an Untracked File by Git, because Git doesn't know the file until we explicitly tell it about that file.

So, to let Git know about the file, we stage the file and commit or push it into the repository and make it a tracked file.

These Untracked Files are generated in two ways:

  1. Manually - By by adding new files to the application. i.e. To create new HTML page, Class file, SQL file etc.
  2. Automatic - These files may also be generated by some process in the application. For example, whenever we do the following things.
    • Build a .NET application - Files generated in bin and obj folders are untracked files.
    • Install node modules - Files generated in node_modulesfolder are untracked files.
Buy Me A Coffee