fenec
fenec

Reputation: 5806

What are untracked files in a Git repository?

What exactly are untracked files in a repository?

Upvotes: 12

Views: 10023

Answers (3)

Ishita Anand
Ishita Anand

Reputation: 1

Untracked files are those files which git is unaware about. Say you create a new file in your project. Git will consider that file as untracked(or unaware in more simple terms). Now we need to tell Git that this file also exist(also called as staging the file) which we can do by git commit or git push commands

Upvotes: 0

Untracked files are new files which have never been staged(added using git add).

  • let's say you had some files you have been working with before now (which you have previously staged using git add). when you make a change in them. Git refers to them as Modified files

  • on the other hand, when you add a new file to the project directory i.e you freshly added a Readme.md file and added some content. Git refers to such a file as an untracked file because it has no stagging/commit history

Upvotes: 1

Adam Vandenberg
Adam Vandenberg

Reputation: 20641

Files in a repo folder that have not been added to the index.

So for instance, if I do:

git diff HEAD^ > some-new-file.diff

Then some-new-file.diff is probably untracked, since I've never done a git add on it before.

Upvotes: 11

Related Questions