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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With