Both of the git add
steps you identify do essentially the same thing, they simply have different explanations because of their arrival route.
The git add
simply tells git that the file provided is a file that you desire to have, in its exact current form (its content), within its source control repository. At that point git will take a snapshot of the file (and it keeps a note in its index) so that it is ready for when you have all your changes to your files ready and added (i.e marshalled together in the staging area), for your git commit
(with appropriate message ;-).
Once git has been told about that file (e.g. @avh's -N
option) it will notice (track) changes to the file under the guise of various commands (such as git status
). Thus, later, you have to explicitly tell git when you no longer want a file to be tracked (git rm <file>
), and you can continue editing a file (locally) after you have add
ed the version that will be in the commit. Almost obviously (or perhaps not), you can git add
a file many times before you commit the final version.