What Does Untracked Mean in Git?

What Does Untracked Mean in Git?

Untracked files are files that have been created within your repo's working directory but have not yet been added to the repository's tracking index using the git add command.

How do I fix untracked files in git?

How to remove local untracked files from the current Git branch
  1. To remove directories, run git clean -f -d or git clean -fd.
  2. To remove ignored files, run git clean -f -X or git clean -fX.
  3. To remove ignored and non-ignored files, run git clean -f -x or git clean -fx.

Why are some git files untracked?

In git, all files which are in the working directory but haven't been explicitly added (i.e. git add ) are marked as "untracked". This effectively means that they exist, but git is not keeping track of changes in them.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.