When you add an unused file, it does not go to the stage immediately?

In the diagram presented on the git -scm page, Writing Changes to the Repository , this shows that when the file is untrackedadded, it goes into state unmodified.

enter image description here

It is right? If I run $ git add myFile, then $ git status, it shows that it is myFileready for a fix, which (from my point of view of a beginner) looks unintuitive when viewing the chart on this page.

Is the chart incorrect, incomplete, or misunderstands the chart? If the latter, please someone can explain what is meant.

+5
source share
3 answers

git add , ( ). , .

+4

, .

git add , . Staged . Staged, Unmodified. , , , , , .

, , , . : . , Staged , , .

+3

- . , , .

, :

, , :

  • unstaged

correct categories for state of the file

Important adjectives are marked in pink. Grays are redundant. You do not need to say: "the file is tracked, modified and arranged." It is enough to say that the “file is delivered”, since each phased file is changed and monitored.

Once you realize this, it is easy to understand that a file without a trace can only be transferred in a phased state. This is done by:

git add [filename]

There are no commands for conversions:

  • untracked file => unmodified file
  • untracked file => uninstalled file
+3
source

All Articles