git-add - Add file contents to the index
Before each commit in git, you need to add file contents to the staging area.
The following will add all the files currently on the stage at the next commit:
$ git add .
This also adds the files recursively under the current working directory. Files previously tracked (i.e. they were in the last commit), still need to be added to the stage.
You can track new files specifically like so (where foo
is the filename in this example):
$ git add foo
To add multiple files, separate them with a space like so (bacon
and cheese
being the other example files):
$ git add foo bacon cheese