I summarize the following criterias:
Committed = Stored in .git directory.
Modified = Changed since checked out, but not in the staging area.
Staged = Modified and put into the staging area.
Tracked = ???
Untracked = ???
But I don’t know how to decide a file as tracked or untracked. I guess there must be some kind of tracked file collection to search for. Though it seems so natural that a newly created file is considered by Git as untracked.
Thanks.
I’m not sure if there is a formal definition, but if you consider tracked as being in HEAD, than that means that the file was tracked in your previous commit. If you consider a file tracked if it is in the index, than the file is tracked as soon as you add or remove it from the index.
Here is how you see all files currently being tracked in HEAD
git ls-tree HEAD^{tree} -rIf you consider tracked as only needing to be in the index you can view tracked files with
git ls-files