Add Files to Staging Area – git add
git add
is the command used when you want to add files to the Staging Area, where you can prepare and check files for registering in your Local Repository.
Add files or directories with a specific path
When running the command, you need to specify which files or directories to add to the Staging Area.
When you want to stage a specific file or directory, you can write the file path or directory path as shown below.
git add [directory or file path]
Add all files under the current directory
When you want to stage all the files and directories under your current directory, you can use the period ".
".
git add .
Add all changes under the working tree
When you want to stage only the files changed from the latest commit (HEAD), you can use the "-A
" option.
git add -A