Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When one adds an untracked file, does it not go to staged immediately?

Tags:

git

git-add

In the diagram shown on the git-scm page, Recording Changes to a Repository, it shows that when an untracked file is added, it moves to the unmodified state.

enter image description here

Is this correct? If I run $ git add myFile then $ git status, it shows that myFile is ready to be committed, which (from my beginner's perspective) looks unintuitive when looking at the diagram on that page.

Is the diagram incorrect, incomplete, or is my understanding of the diagram incorrect? If the latter, please could someone explain what is meant.

like image 278
ataulm Avatar asked Mar 05 '13 16:03

ataulm


1 Answers

When you git add a new previously untracked file, it is staged immediately (the blue stage in the image). The diagram is misleading in that regard, but the text on that page says as much under the paragraph Tracking New Files.

like image 162
eagleflo Avatar answered Sep 23 '22 16:09

eagleflo