Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are untracked files in a Git repository?

What exactly are untracked files in a repository?

like image 634
fenec Avatar asked Dec 06 '10 17:12

fenec


People also ask

What are untracked files 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.

Why some files are untracked in git?

Untracked basically means that Git sees a file you didn't have in the previous snapshot (commit), and which hasn't yet been staged; Git won't start including it in your commit snapshots until you explicitly tell it to do so.

How do you get rid of untracked files in git?

Run 'git clean -f' to force untracked file deletion; Use 'git clean -f -d' to remove untracked directories; Use 'git clean -f -x' to remove untracked .


1 Answers

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.

like image 198
Adam Vandenberg Avatar answered Sep 21 '22 21:09

Adam Vandenberg