To add changes to the staging area in Git, you use the git add command. Here are a few examples:
-
To add a specific file:
git add filename.txt -
To add multiple specific files:
git add file1.txt file2.txt -
To add all changes in the current directory:
git add . -
To add all files with a specific extension (e.g.,
.js):git add *.js
This command prepares your changes for the next commit.
