git add . is a Git command used to stage all changes made to a working directory, before committing them.
Here is an example:
Suppose you made changes to two files named
file2.txt. You want to include both changes in your next commit.
To do so, first navigate to the project directory in the terminal and execute:
git add .
This command stages all of the changes made in repository. You can now review the changes staged by executing:
You should see that
file2.txt have been staged.
Now you can commit the staged changes by running:
git commit -m "Added new feature to file1.txt"
The commit will include all changes.